Functions

Trigger Real-Time Business Logic

Create and execute business logic across connected experiences at scale - from language translation to moderation, IoT sensor data aggregation, geo-triggering and more.

What can you do with Functions?

Execute Functions with serverless chat messaging

Execute Functions on the edge to route, filter, transform, augment and aggregate real-time messages as they route through the PubNub network.

Secure REST Endpoint Functions for pubnub responsiveness

Utilize one-click secure REST endpoint functions to respond directly to HTTP requests and integrate 3rd party service without spinning up servers.

Sync and Async Triggers with pubnub functions

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

Why are Functions Different?

  • Low Latency Your logic is executed where your data is streaming in, and replicated across PubNub’s 15 Points of Presence. Your functions will trigger instantly, usually in < 10ms.

  • 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 Compliant, SOC 2 Compliant

    • Data Shield certified and EU-only data storage options

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


  • Serverless You never have to worry about servers and infrastructure issues. PubNub Functions scales automatically as users and devices increase, and handles all the deployment of your code. 

  • Multiple ways to access Endpoints trigger 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.

Where are Functions Used?

Monitor IoT Temperature Stream with pubnub functions

IoT

In IoT sensors, users can monitor a temperature data stream for anomalies.

Translate Messages in Flight with serverless chat

Translation

During chat, users can mutate messages in flight, like translating multi-language conversations.

Redirect Messages to 3rd Party with pubnub finance functions.

Finances

For a finance company, users can redirect messages to a third party service, like sending stock data to an analytics platform.

Frequently Asked Questions

What is the value of running functions code in PubNub?
When should I use Functions over E&A?
What are some common use cases where Functions are used?