pubnub-functions

Installation
SKILL.md

PubNub Functions 2.0

Core Workflow

  1. Identify Function Type: Before Publish, After Publish, On Request, or On Interval
  2. Design Logic: Plan the transformation, integration, or business logic
  3. Implement Function: Write async/await code with proper error handling
  4. Use Modules: Leverage kvstore, xhr, vault, pubnub, crypto modules
  5. Validate Implementation: Verify no hardcoded secrets (use vault), confirm async/await usage (no .then() chains), check operation count stays within the 3-operation limit, and ensure proper try/catch wrapping
  6. Handle Response: Return ok()/abort() or send() appropriately
  7. Configure Channel Patterns: Set wildcard patterns ending with .*, max two literal segments before wildcard
  8. Test in Staging: Test the function in PubNub Admin Portal with sample messages before enabling on production channels
  9. Deploy to Production: Enable the function on live channel patterns and monitor logs

Reference Guide

Reference Purpose
functions-basics.md Function structure, event types, async/await patterns
Related skills
Installs
23
Repository
pubnub/skills
GitHub Stars
3
First Seen
Feb 5, 2026