pubnub-keyset-management/SKILL.md
Manages PubNub apps, keysets, and environment separation. Covers the publish/subscribe/secret key model, dev/staging/prod isolation, key rotation hygiene, demo-key boundaries, and custom origin configuration. Use when setting up a new PubNub project, separating environments, rotating keys, configuring demo or production keysets, or asking about apps, keysets, or custom origins.
npx skillsauth add pubnub/skills pubnub-keyset-managementInstall 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 foundational PubNub setup specialist. Your role is to help developers establish proper apps, keysets, and environment separation before any other PubNub work begins.
Invoke this skill when:
manage_apps or manage_keysets MCP toolsA PubNub App is a logical container that holds one or more Keysets. Each Keyset is an independent set of keys (publish + subscribe + secret) and feature configuration (Presence, Persistence, Access Manager, etc.). You typically create one App per product and one Keyset per environment within that App.
| Key | Where it lives | Purpose |
|---|---|---|
| Publish key (pub-c-...) | Client AND server | Sending messages |
| Subscribe key (sub-c-...) | Client AND server | Receiving messages |
| Secret key (sec-c-...) | Server only — never client | Granting Access Manager tokens, admin operations |
const PubNub = require('pubnub');
const pubnub = new PubNub({
publishKey: process.env.PN_PUBLISH_KEY,
subscribeKey: process.env.PN_SUBSCRIBE_KEY,
secretKey: process.env.PN_SECRET_KEY,
userId: 'server-instance-' + os.hostname()
});
For client SDK initialization, see the canonical owner: pubnub-app-developer/references/sdk-patterns.md. Clients receive only the publish + subscribe keys, never the secret.
When this skill is active, prefer these user-pubnub MCP tools:
manage_apps — list, create, inspect, and update apps in the Admin Portalmanage_keysets — list, create, inspect, and update keysets; toggle add-ons (Presence, Persistence, Access Manager, Stream Controller, etc.)For Access Manager grants themselves (which require the secret key), see pubnub-security/references/access-manager.md.
new PubNub(...) client SDK initialization patterns and userId requirementsWhen providing implementations:
tools
Builds real-time analytics and automation with PubNub Illuminate. Covers Business Objects (schema), Metrics (aggregations), Decisions (threshold-triggered actions with the 4-step PUT workflow), Queries (ad-hoc vs saved pipelines), and Dashboards. Use when tracking KPIs, building threshold alerts, automating mute/publish/App-Context-update actions, detecting spam or anomalies, or visualizing live activity.
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.
tools
Deliver real-time sports scores, play-by-play, and scoreboards with PubNub
development
Create, configure, and deploy PubNub Functions 2.0 event handlers, triggers, and serverless endpoints. Covers Before/After Publish, On Request, On Interval; built-in modules (kvstore, xhr, vault, pubnub, crypto, jwt, ugc, jsonpath, advanced_math, codec/*); chaining (3 hops, 5 consecutive, Chaining vs Forking, kvstore state sharing); runtime quirks (3-call external cap, 10-call vault cap, cold start, request.path normalization, vault availability, sendFile message); DB-trigger patterns; and bundling/TypeScript workflow (esbuild externals, 64KB guard, __require shim stripping, default-export shape). Use when building real-time message transformations, edge data processing, REST endpoints backed by PubNub, webhook integrations, or shipping bundled/transpiled TypeScript Functions from inside the message pipeline.