mcpField
P
pubnub-presence

pubnub-presence

github.com/pubnubDevelopment658 installsUpdated 7w ago
Repository

About pubnub-presence

pubnub-presence is a specialist skill for developers building PubNub real-time applications. It covers presence event orchestration, disconnect handling, and multi-device patterns, while directing API details to PubNub MCP or official documentation.

Key features

  1. 01Guidance for enabling Presence and channel rules
  2. 02Fetch initial occupancy before processing live events
  3. 03Distinguish leave, timeout, and disconnect states
  4. 04References for heartbeat, timeout, and multi-device design
  5. 05Manage event volume on large channels

Use cases

  1. 01Show channel members' online status
  2. 02Combine initial occupancy with join and leave events
  3. 03Handle disconnects and multi-device presence
  4. 04Verify presence event flow in staging

MCP support

The skill directs users to PubNub MCP tools for SDK documentation and staging event-flow verification. It requires PubNub MCP for API shapes, limits, configuration values, or live operations.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pubnub/skills --skill pubnub-presence

After installing, type/pubnub-presencein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

tile.json
evals/
instructions.json
summary_infeasible.json
summary.json
evals/scenario-0/
capability.txt
criteria.json
task.md
evals/scenario-1/
capability.txt
criteria.json
task.md
evals/scenario-2/
capability.txt
criteria.json
task.md
evals/scenario-3/
capability.txt
criteria.json
task.md
evals/scenario-4/
capability.txt
criteria.json
task.md
references/
dropped-connections.md
multi-device-sync.md
presence-patterns.md
presence-setup.md

Details

From the project README

PubNub Presence Specialist

Precedence: PubNub MCP tools and pubnub.com/docs are authoritative for API shapes, limits, and configuration values. This skill is authoritative for patterns, sequencing, and design tradeoffs.

When PubNub MCP tools are absent: Treat PubNub MCP as absent only when this session has no PubNub MCP tools (typically namespace user-pubnub). Do not ask the user to check MCP if those tools are already listed. If they are absent and the task needs API shapes, limits, tool schemas, configuration values, or live keyset/runtime operations: tell the user once that PubNub MCP should be enabled (https://www.pubnub.com/docs/ai/pubnub-mcp-server); this skill can still provide patterns, sequencing, and design tradeoffs. Do not treat training data as authoritative for those facts — do not emit confident SDK method signatures, numeric limits, or MCP tool argument lists from memory. Continue with pattern-level guidance, or stop on the fact-dependent part until MCP is enabled. Chat questions still route to Chat SDK docs/MCP (get_chat_sdk_documentation), not Core SDK.

Core Workflow

  1. Enable & scope — Presence add-on + Presence Management channel rules (presence-setup.md).
  2. Subscribe with presence — retrieve API from get_sdk_documentation.
  3. Seed then stream — hereNow for initial occupancy; join/leave/timeout events for deltas.
  4. Tune heartbeat/timeout — trade latency vs event volume (presence-setup.md).
  5. Handle disconnects — dropped-connections.md + backoff.
  6. Multi-device — multi-device-sync.md.

Reference Guide

ReferencePurpose
presence-setup.mdPortal prerequisites, heartbeat tuning
presence-patterns.mdScalable presence patterns
dropped-connections.mdStatus categories vs presence leave
multi-device-sync.mduserId design for multiple devices

Event orchestration

PhaseAction
InitialAfter connect, fetch occupancy (hereNow) before trusting empty UI
LiveApply join/leave/timeout/state-change deltas — retrieve event shapes from SDK docs
High occupancyExpect interval events; batch UI updates
Leave UXDistinguish explicit leave vs timeout vs disconnect (dropped-connections.md)

Constraints

MCP Tools

  • get_sdk_documentation — presence APIs, hereNow, state
  • subscribe_and_receive_pubnub_messages — verify event flow in staging

See Also

  • pubnub-app-developer — pub/sub primitives
  • pubnub-app-context — persistent user metadata alongside presence
  • pubnub-observability — presence flapping runbook
  • pubnub-scale — large-event occupancy

Comments

Markdown supported