Functions

Run your custom code on our infrastructure

In-stream data manipulation without the infrastructure overhead

Offload your business logic to PubNub and eliminate scalability issues

Enhance Customer Experience

Execute your code at the edge with ultra-low latency, ensuring very responsive customer experiences. Modify events in flight for real-time moderation, translation, and more.

Minimize Costs

Use edge processing to transmit and store only the data that matters most. Save development time with pre-built integrations, logging capabilities, and a debug console.

Reduce Operational Risk

Offload your business logic to PubNub—removing concerns about downtime, scalability, and compliance. Enjoy zero upfront costs with our pay-as-you-go pricing model.

Leverage ultra-low latency to create cutting-edge experiences

Dynamic messaging

Implement real-time translation, enforce automated content moderation, and dynamically route messages for seamless, efficient communication.

Data pre-processing

Filter data at the edge, aggregate IoT sensor inputs, and deliver live leaderboards for real-time, interactive user experiences.

Reacting to events

Build real-time data pipelines to trigger personalized notifications, enable geofencing, and detect trends or anomalies for actionable insights.

  • Serverless architecture: Build and deploy functions without managing infrastructure—focus on coding while PubNub handles scaling and maintenance.
  • In-flight processing: Modify messages and events in real-time for moderation, translation, filtering, rerouting, and much more.
  • Pre-built integrations: Connect seamlessly to services like AI, chatbots, voice, video, SMS, maps, and moderation tools.
  • Built-in events: Trigger functions on key events like publish, file, signal, presence, requests, or intervals.
  • Pre-built modules: Accelerate development with ready-to-use modules for encryption, secret management, and beyond.
  • Debug Console: Test and debug functions within PubNub; export logs to services like AWS or Kafka.
  • Distributed storage: Maintain global application state with a reliable key-value store.
  • Edge processing: Run functions near data sources for lower latency and real-time performance.
  • Enterprise-grade: Ensure security with SOC 2, HIPAA compliance, AES encryption, and EU data storage options.

See who’s using Functions to tackle toughest real-time challenges

Happiest Baby

Happiest Baby utilizes PubNub Functions in their SNOO Smart Sleeper Bassinet to instantly process and react to critical data, delivering adaptive and personalized care for babies and their parents.

IntelliScape.io

IntelliScape.io leverages PubNub Functions in its Internet of Recognition platform to enable real-time responses to voice requests and commands.

Frequently Asked Questions

expand_less

How do PubNub Functions differ from external services like AWS Lambda?

PubNub Functions offers a unique advantage by operating directly within the PubNub network, providing real-time data transformation, enrichment, and event handling with minimal latency. Unlike external services like AWS Lambda, which requires sending traffic out of the PubNub network for code execution and then retrieving responses, PubNub Functions execute in the same environment as the events they process. This ensures faster, more efficient performance, ideal for low-latency, real-time applications such as live chats, gaming, or IoT.

Additionally, PubNub Functions significantly reduces system and architectural complexity. Simplify your tech stack and focus on building your application without the need to integrate or manage external services. PubNub Functions also leverages a distributed, edge-based architecture, enabling data to be processed closer to the source of events. This edge processing capability not only reduces latency further but also enhances reliability and scalability, making it a powerful choice for real-time use cases.


PubNub Functions offers a unique advantage by operating directly within the PubNub network, providing real-time data transformation, enrichment, and event handling with minimal latency. Unlike external services like AWS Lambda, which requires sending traffic out of the PubNub network for code execution and then retrieving responses, PubNub Functions execute in the same environment as the events they process. This ensures faster, more efficient performance, ideal for low-latency, real-time applications such as live chats, gaming, or IoT.

Additionally, PubNub Functions significantly reduces system and architectural complexity. Simplify your tech stack and focus on building your application without the need to integrate or manage external services. PubNub Functions also leverages a distributed, edge-based architecture, enabling data to be processed closer to the source of events. This edge processing capability not only reduces latency further but also enhances reliability and scalability, making it a powerful choice for real-time use cases.


expand_more

When should I use Functions over E&A?

Use Functions when you need to manipulate in-stream data in real time, such as routing, filtering, transforming, aggregating, or enriching messages.

Use Events & Actions (E&A) when you need to reliably export and scale data streams, particularly for many-to-one (fan-in) use cases like IoT data collection or integrating with external systems.

expand_more

How is PubNub Functions priced?

PubNub Functions is billed based on the number of executions and transactions they generate—such as publishes, saving/retrieving key-value pairs, or webhooks. Transactions from Functions are counted toward the monthly active user (MAU) transaction limits of your plan.

expand_more

Is PubNub Functions available to free customers?

Yes, PubNub Functions is available to both free and paid customers. Free-tier customers can use Functions for testing or proof of concept purposes, but with limitations:

  • Execution is limited to 7 days.
  • Limited infrastructure resources.
  • No built-in high availability.

For production use, upgrading to the Starter or Pro plan is recommended for unrestricted access and full support.


Ready to get started?