PubNub Functions

A serverless environment to execute functions on the edge, transforming, enriching, and ﬁltering 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, ﬁltering, 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?

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

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

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

Example Use Cases

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

Translating multi-language chat conversations in-network.

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 certiﬁed, and EU-only Data Storage options

Vault - a secure store for private information, such as passwords or API keys

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

Analyze, sort, categorize and tag images sent via chatTranslate chat messages to 11 different languagesTrigger an email based on user interaction or if a user is offlineImageRecognitionand AnalysisLanguage TranslatorTransactional Email

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.