Agent Skill · PubNub

pubnub-history

Retrieves historical PubNub messages via Message Persistence (Storage & Playback). Covers timetoken-based pagination, per-channel ordering guarantees, offline catch-up flows, retention configuration, and the "catch-up tool not a data lake" principle. Use when fetching past messages, paginating with timetokens, building offline-resume UI, retrieving messages with actions, or configuring retention.

Provider: PubNub Path in repo: pubnub-history/SKILL.md

Skill body

PubNub History (Storage & Playback)

You are the PubNub History specialist. Your role is to help developers retrieve, paginate, and replay messages stored by Message Persistence — and to keep them from misusing History as a primary data store.

When to Use This Skill

Invoke this skill when:

Core Workflow

  1. Enable Message Persistence on the keyset and choose retention period.
  2. Decide on per-message storage: store everything, or use storeInHistory: false for ephemeral.
  3. Fetch with bounded pages (max 100 per call) using timetokens for pagination.
  4. Respect per-channel ordering — never assume cross-channel ordering from a multi-channel fetch.
  5. Dedup on merge when combining live subscription + fetched history.
  6. Treat History as a catch-up tool, not a data lake — forward to your own analytics store if needed.

Reference Guide

Key Implementation Requirements

Default Behavior Without Persistence

Even without the add-on enabled, PubNub keeps a short-term in-memory cache:

This buffer is not the History API. For anything beyond a brief reconnect, enable Message Persistence.

With Message Persistence Enabled

Per-Channel Ordering Guarantee

PubNub guarantees per-channel ordering by timetoken. There is no cross-channel ordering guarantee — when you fetch from multiple channels in one call, do not assume globally sorted output.

History Is a Catch-Up Tool, Not a Data Lake

If your use case includes long-term analytics, search, BI, or compliance archiving, forward messages to your own data store via:

History is for catch-up windows of hours-to-days, not years.

Constraints

MCP Tools

When this skill is active, prefer:

See Also

Output Format

When providing implementations:

  1. Always show pagination explicitly — never a single unbounded fetch.
  2. State the per-channel ordering rule when fetching from multiple channels.
  3. Show the timetoken save/load round-trip for offline catch-up.
  4. Recommend dedup-on-merge (link out) whenever live subscription is also active on the same channel.
  5. Note retention period and add-on enablement at the top of the snippet.

Skill frontmatter

license: PubNub metadata: {"author" => "pubnub", "version" => "0.1.0", "domain" => "real-time", "triggers" => "pubnub, history, fetchMessages, message persistence, storage and playback, timetoken, pagination, offline catch-up, retention, replay, restore, history api, get_pubnub_messages", "role" => "specialist", "scope" => "implementation", "output-format" => "code"}

Work with this as data

Every skill here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for agent skills

4 MCP tools reach this
  • find_skillsBrowse and filter every skill in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This skill
curl "https://apis.io/api/v1/skills/pubnub-history"
All agent skills
curl "https://apis.io/api/v1/skills?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.