pubnub-chat/SKILL.md
Build chat applications with PubNub Chat SDK — direct/group conversations, typing indicators, message actions (reactions, edits, read receipts), file sharing, and threaded messages. App Context (user/channel metadata) is owned by pubnub-app-context; presence is owned by pubnub-presence; this skill focuses on chat-specific Chat SDK APIs.
npx skillsauth add pubnub/skills pubnub-chatInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the PubNub Chat SDK specialist. Your role is to help developers build chat applications using PubNub's Chat SDK.
Invoke this skill when:
User and channel metadata (App Context / Objects API) is owned by pubnub-app-context. Presence (online/offline, here-now, multi-device sync) is owned by pubnub-presence. Foundational pub/sub is owned by pubnub-app-developer. Offline catch-up for chat scrollback is owned by pubnub-history. Server-side moderation in Functions Before Publish is owned by pubnub-functions. Do not duplicate that material here.
userId.sendText.| Reference | Purpose | |-----------|---------| | chat-setup.md | Chat SDK initialization + auth integration | | chat-features.md | Channels, messages, typing indicators | | chat-patterns.md | User flow, channel types, real-time sync | | message-actions.md | Reactions, edits, deletes, read receipts | | file-sharing.md | sendFile, file metadata, file download | | threading.md | Thread channels, reply-in-thread, thread previews |
Cross-references: Built on pub/sub basics and SDK initialization (
new PubNub(,userId/UUID). User/channel/membership metadata uses App Context. For presence in chat (typing → online/offline mapping) seepubnub-presence. For Access Manager grants on chat channels seepubnub-security.
import { Chat } from '@pubnub/chat';
const chat = await Chat.init({
publishKey: 'pub-c-...',
subscribeKey: 'sub-c-...',
userId: 'user-123',
authKey: 'auth-token-from-server'
});
const { channel } = await chat.createDirectConversation({
user: interlocutor,
channelData: { name: 'Direct Chat' }
});
channel.connect((message) => {
console.log('Received:', message.text);
});
await channel.sendText('Hello!');
authKey (not raw token) for Access Manager authentication on Chat SDK.userId must be persistent and unique per user (see SDK userId/UUID owner).get_chat_sdk_documentation — pull Chat SDK reference per language (see intent-to-tool routing)write_pubnub_app — scaffold a chat app from this skill's templatesWhen providing implementations:
tools
Cross-cutting reliability patterns for PubNub apps. Covers reconnect with exponential backoff + jitter, idempotent publish with client-generated message IDs, dedup-on-merge for live + history streams, queue-and-retry for offline writes, and schema versioning of message envelopes. Use during design reviews, when planning offline support, or during incident response when network or delivery reliability is the concern.
testing
Scale PubNub applications for high-volume real-time events using channel groups, wildcard subscriptions, sharding, and large-event readiness. Covers Stream Controller add-on, hard caps, payload coalescing referenced into pubnub-observability, and the engagement model for 10K+ concurrent live events. Persistence/history is owned by pubnub-history.
development
Build real-time multiplayer games with PubNub game state sync
development
Build real-time voting and polling systems with PubNub