functions-group
HIDE/functions-introduction/
Functions
This group of endpoints allows you to manage Functions in your PubNub account.
Functions let you execute custom logic in response to messages, events, or HTTP requests on the PubNub network. Code runs on managed infrastructure with automatic scaling, so you can add real-time features without maintaining your own servers.
Core Concepts:
- Packages — containers that group related functions together with shared configuration
- Revisions — immutable, versioned snapshots of a package's functions and code
- Deployments — running instances of a package revision on a keyset, deployed across PubNub's global infrastructure
Function Types:
- Before Publish/Signal/File — intercept and transform messages on a channel before delivery
- After Publish/Signal/File — react to messages on a channel asynchronously after delivery
- On Presence — react to user presence events (join, leave, timeout)
- On Interval — execute on a schedule for background processing
- On Request — expose custom HTTP endpoints accessible via the PubNub domain