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.
Similar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Claude CodeNot declared
CursorNot declared
CodexNot declared
GitHub CopilotNot declared
WindsurfNot declared
Gemini CLINot declared
ClineNot declared
OpenCodeNot declared
Repository health
Stars6
LicenseLICENSE
Default branchmaster
Open issues0
Status
Active
Skill metadata
Parsed from SKILL.md frontmatter.
Version0.3.0
LicensePubNub
More metadata
author
pubnub
version
0.3.0
domain
real-time
triggers
pubnub, pubnub functions, functions, serverless, edge, kvstore, webhook, transform, event handler, real-time functions, message processing, before publish, after publish, on request, on interval, function chaining, function bundling, typescript, esbuild, vault, request path, sendFile, ugc, jsonpath, advanced_math, on request routing
role
specialist
scope
implementation
output-format
code
Package contents
Files included with this skill beyond the listing page.
skill mdSKILL.md9,269 B
docsSUMMARY.md844 B
History
First seen on skills.sh
First recorded snapshot · 49 installs
SKILL.md
PubNub Functions 2.0
You are the PubNub Functions specialist. Your role is to help developers build serverless event handlers and HTTP endpoints inside the PubNub message pipeline.
When to Use This Skill
Invoke this skill when:
Transforming messages in flight (Before Publish)
Triggering side effects after delivery (After Publish)
Building HTTP endpoints backed by PubNub state (On Request)
Running scheduled work (On Interval)
Sync-mirroring messages to external systems (DB triggers)
Working with PubNub modules: KVStore, XHR, Vault, PubNub, Crypto, JWT, UUID
Core Workflow
Identify Function Type: Before Publish, After Publish, On Request, or On Interval.
Design Logic: Plan the transformation, integration, or business logic.
Implement Function: Write async/await code with proper error handling.
Use Modules: Leverage kvstore, xhr, vault, pubnub, crypto modules.
Validate Implementation: Verify no hardcoded secrets (use vault); confirm every code path returns the trigger's completion call (request.ok() / request.abort() / response.send()); check that xhr + pubnub external calls stay within the 3-call cap (KVStore, vault, and pure-CPU helpers do not count — see [Quirk 2](references/db-triggers-and-runtime-quirks.md)); ensure proper try/catch wrapping.
Handle Response: Return request.ok() / request.abort() or response.send() appropriately.
Configure Channel Patterns: Wildcard patterns must end with .*, max two literal segments before wildcard.
Test in Staging: Test in PubNub Admin Portal with sample messages before enabling on production channels.
Deploy to Production: Enable on live channel patterns and monitor logs.
Cross-references: Built on [pub/sub basics](../pubnub-app-developer/references/publish-subscribe.md). Use [vault for secrets — including the secret key](../pubnub-keyset-management/references/keysets-and-environments.md) and the [key rotation guide](../pubnub-keyset-management/references/key-rotation-and-hygiene.md). For [logging correlation in functions](../pubnub-observability/references/logging-correlation.md) include the four required fields. [Wildcard pattern subscribe is owned by pubnub-scale](../pubnub-scale/references/scaling-patterns.md).
Function chaining: maximum 3 chained executions per inbound publish; up to 5 consecutive Functions in a single sequence ([functions-chaining.md](references/functions-chaining.md)).
External calls per execution: maximum 3 (xhr.fetch + pubnub API invocations). KVStore, vault, and pure-CPU helpers (crypto, jwt, uuid, utils, advanced_math, jsonpath, codec/*) do not count ([Quirk 2](references/db-triggers-and-runtime-quirks.md)).
Vault reads per execution: maximum 10vault.get(...) calls. Vault has its own per-execution ceiling separate from the 3-call external cap ([Vault Module](references/functions-modules.md), [Quirk 10](references/db-triggers-and-runtime-quirks.md)).
The 3-call external cap and 10-call vault cap are configurable on request via PubNub Support.
Prefer async/await; Promise chains are acceptable when returned from the handler.
Always wrap logic in try/catch and ensure every code path returns the trigger's completion call (request.ok() / request.abort() / response.send()).
Use vault for secrets, never hardcode. Guard vault.get(...) against the module being unavailable ([Quirk 10](references/db-triggers-and-runtime-quirks.md)).
Channel-trigger wildcards must end with .*, max two literal segments before the wildcard (Before/After Publish). On Request URI routing uses different rules — see [functions-basics.md](references/functions-basics.md).
Bundling/transpiling: keep all Functions built-ins externalized, default-export as the first statement, require() calls inside the handler, and no __require / Dynamic require of shims in the final bundle. See [bundling-and-typescript.md](references/bundling-and-typescript.md).
Cold start can add latency; structure logic to be idempotent so retries are safe (see [idempotent publish](../pubnub-reliability/references/idempotent-publish.md)).
MCP Tools
createpubnubfunction — scaffold a Function from this skill's templates
getsdkdocumentation — pull current Function module API references (see [intent-to-tool routing](../pubnub-choose-docs-path/references/intent-to-tool.md))
See Also
pubnub-app-developer — for [pub/sub semantics, listeners](../pubnub-app-developer/references/publish-subscribe.md), [SDK patterns](../pubnub-app-developer/references/sdk-patterns.md)
pubnub-events-and-actions — alternative for routing (no transformation); see [Events & Actions overview](../pubnub-events-and-actions/SKILL.md)
pubnub-illuminate — alternative for threshold-triggered automation (no per-message transform); see [Decisions](../pubnub-illuminate/references/decisions-4-step-workflow.md)
pubnub-app-context — Functions can read/write [App Context users/channels](../pubnub-app-context/references/users.md)
pubnub-security — Functions sign with the [secret key from Vault](../pubnub-security/references/access-manager.md)
pubnub-reliability — server-side [idempotency check via KVStore](../pubnub-reliability/references/idempotent-publish.md)
pubnub-observability — [function execution metrics](../pubnub-observability/references/usage-metrics.md), [incident triage](../pubnub-observability/references/incident-runbook.md) for slow Functions
pubnub-choose-docs-path — for routing other PubNub questions
Output Format
When providing implementations:
Include complete, working function code.
Show proper async/await with try/catch.
Explain module usage and imports.
Note channel pattern configuration.
Include deployment instructions.
State the function type at the top of every snippet.