pubnub-functions

Execute serverless PubNub Functions for real-time message transformation and webhook invocation.

3|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/sjmaple/skills --skill pubnub-functions-sjmaple
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pubnub-functions
Source: https://github.com/sjmaple/skills/tree/main/pubnub-functions
Command: npx skills add https://github.com/sjmaple/skills --skill pubnub-functions-sjmaple

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PubNub Functions 2.0 enables real-time edge processing by running serverless JavaScript on PubNub's network, allowing you to transform messages, route webhooks, and invoke scheduled logic without managing infrastructure.

Core Features & Use Cases

  • Event-driven, edge-executed code for Before Publish, After Publish, On Request, and On Interval.
  • Built-in modules (kvstore, xhr, vault, pubnub, crypto) to implement transformations, integrations, and automation.
  • Use cases include real-time message enrichment, webhook integrations, and lightweight REST endpoints, plus periodic tasks run on schedules.

Quick Start

Create and deploy a new Function in the PubNub Admin Portal, attach a trigger (e.g., chat.* or orders.*), and configure vault secrets before going live.

Frequently Asked Questions about pubnub-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run serverless JavaScript functions at the edge for real-time message processing?

Serverless functions at the edge are executed using PubNub Functions to handle real-time event processing, allowing you to transform messages and invoke webhooks without managing infrastructure. You deploy them by creating a Function in the PubNub Admin Portal and attaching triggers like Before Publish or After Publish.

Can I use async/await and external HTTP requests in PubNub Functions?

Yes, PubNub Functions enforce async/await best practices and support built-in modules like xhr for external HTTP requests and crypto for encryption. This enables production-grade workflows by allowing asynchronous data fetching and secure message transformation within your edge code.

What is the best way to store secrets and configuration for edge-deployed webhooks?

The best way to store secrets for edge-deployed webhooks is using the built-in vault module. PubNub Functions utilize vault-based secrets to securely manage sensitive configuration data, ensuring your production-grade workflows keep credentials safe without hardcoding them into your JavaScript logic.

Does PubNub Functions support scheduled tasks and lightweight REST endpoints?

Yes, PubNub Functions support scheduled tasks through the On Interval trigger and lightweight REST endpoints via the On Request scenario. This allows you to execute periodic serverless logic on schedules and handle incoming web requests directly on the edge network.

How do I persist data and state across serverless function invocations?

You persist data and state across serverless function invocations using the built-in kvstore module. This key-value storage enables real-time message enrichment and stateful automation by allowing your edge functions to retrieve and save data between different event triggers.

What are the limitations when deploying serverless functions at the edge?

Limitations when deploying serverless functions at the edge include keeping operation counts within allowed limits and strictly following channel pattern rules. Proper try/catch error handling is enforced to ensure your event-driven workflows remain stable and do not exceed platform constraints.