PubNub Functions

PubNub Functions

A serverless environment to execute functions on the edge, transforming, enriching, and filtering messages as they route through the PubNub network

PubNub Functions enable the creation and execution of business logic on messages at the edge of the network. Quickly build microservices and incorporate logic like re-routing, augmenting, filtering, transforming, and aggregating data. PubNub Functions are serverless, there is no need to worry about deploying, maintaining, or scaling server infrastructure.

What Can You Do with PubNub Functions?

Route

Route, filter, transform, augment, aggregate, and transform realtime messages.

Endpoint

One-click secure REST endpoint functions make new functionality a breeze to build and deploy.

Sync

Trigger sync and async functions so processing can happen as data streams in or afterwards.

Httpcalls

Enrich messages with HTTP calls to 3rd party APIs and services.

Example Use Cases

Utilizing IoT sensors

Utilizing IoT sensors and serving an event when there is a temperature anomaly.

Translating multi-language chat

Translating multi-language chat conversations in-network.

Deploying chatbots

Deploying chatbots to enrich conversations in social platforms.

Making Realtime Innovation Work

Low Latency

Your logic is executed where your data is streaming in, and replicated across PubNub’s 15 Points of Presence. PubNub guarantees less than 10ms triggered execution time for Functions.

  • 11:30:14 block: Deploying in regions: Eastern US,
  • Western US, Asia, Western Europe,
  • Central Europe, South America.
  • 11:30:15 block: Module is now globally deployed
Enterprise Grade

PubNub Functions maintain a global key/value store to keep the application state. They deploy and scale automatically, so you do not have to worry about operational issues.


Enterprise-grade security comes built in, including:

  • AES message encryption
  • HIPAA Compliance, SOC 2 Compliant
  • Data Shield certified, and EU-only Data Storage options
  • var pubnub = new PubNub({
  • subscribeKey: ‘subscribeKey’,
  • publishKey: ‘publishKey’,
  • cipherKey: ‘cipherKey’ //secret key used to create AES signature
  • });
Serverless

Never worry about servers and infrastructure issues. PubNub Functions scales automatically as users and devices increase, and handles all the deployment of your code.

  • Create
  • /v1/blocks/key/178088/event_handler
  • Start
  • /v1/blocks/key/178088/block/71/start
  • Stop
  • /v1/blocks/key/178088/block/71/stop
Multiple Ways to Access

Endpoints triggers an event handler and assigns a URL to your function to execute it with an HTTP request. You can also modify data with event-based triggers, before publishing and/or after publishing.

Select
  • Before Publish or Fire
  • After Publish or Fire
  • After Presence
  • On Request
Path
YourTestRest COPY URL
Enhance Chat with PubNub Functions
Catalog

Get Started Even Quicker with BLOCKS

The BLOCKS Catalog is a growing collection of prebuilt applets for chat, alerts, geolocation, graphing, IoT, and more, and are replicated across the edge of the PubNub network.

PubNub has partnered with dozens of leading companies to provide easily integratable partner functions to suit your use cases.



Getting Started

Functions Quickstart
Functions Quickstart

Setting up and deploying a function with PubNub.

Read Quickstart
Functions Tutorials
Functions Tutorials

Tutorials for using different types of functions.

Read Tutorials
API Documentation
API Documentation

Comprehensive technical docs and best practices.

Read Documentation

Try PubNub Today

Connect up to 100 devices for Free