Events & Actions
Events & Actions (E&A) allows you to manage all the events in your application's ecosystem and send real-time data to third-party systems for storage, analytics, or machine learning/artificial intelligence without having to write code.
How it works
Events are small pieces of information generated by PubNub based on your explicit and implicit usage. They're generated during the app's lifecycle, for example, when it connects, disconnects, or makes API calls, like publishing a message or subscribing to a channel. You can react to these events with a listener and their associated actions.
Scenario | PubNub event | Description |
---|---|---|
Device publishes a message via an API call | PubNub generates a Message Publish event | The Publish API call made by a customer’s device triggers PubNub to fire a Message Publish event. This is an explicit event. |
User’s phone loses Internet connection | PubNub generates a User Disconnect event | Even though the user’s device doesn’t make an API call to PubNub, we detect that the connection is gone. This is an implicit event. |
Once you've configured a listener (1) to activate upon a particular event, you can define several actions (2) that you want to occur, such as sending the data by a webhook or a queue. You can also define actions independently of creating a listener and associate them with listeners any time later.
Events & Actions is accessible via the Admin Portal.
Availability
Events & Actions is available to PubNub customers on Free, Starter, and Pro plans in eight tiers.
Item | Free | Intro | Tier 1 | Tier 2 | Tier 3 | Tier 4 | Tier 5 | Tier 6 |
---|---|---|---|---|---|---|---|---|
Max events ingested | 10K | 2M | 4M | 25M | 66M | 200M | 500M | Unlimited |
Listeners | 1 | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited | Unlimited |
Actions per listener | 1 | 3 | 3 | 3 | 3 | 3 | 3 | Unlimited |
Action Types per Listener | Webhook only | All Available Actions | All Available Actions | All Available Actions | All Available Actions | All Available Actions | All Available Actions | All Available Actions |
Retry | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
Event listeners
Event listeners wait for different PubNub events to occur, and when they do, the listener is activated, for example:
- A message is published to a specific channel.
- A user with a particular Sender ID publishes a message.
- The message metadata matches a pattern you define.
Each event listener may have several actions associated with it. When an event happens, say a client with the User ID of thomas_anderson
publishes a message, PubNub triggers all actions associated with a particular event listener.
For an overview of available events, refer to Event/Action List.
Actions
Actions are configurable ways to send data when an event listener is activated.
Actions per listener
The number of actions a single event listener may trigger depends on your Events & Actions tier.
Available actions include:
Events & Actions vs. Functions
PubNub supports two distinct approaches to event-driven processing.
-
If you're looking for a low-code solution to send real-time data moving through PubNub to a third-party system for additional processing, use Events & Actions.
-
If you're looking to change messages on the fly before publishing them, implement any custom business logic (like aggregating data), or like to write code, use Functions.
Configure Events & Actions
Events & Actions is simple to configure and set up using the Admin Portal UI. This feature comes out of the box with a robust webhook retry for paid customers and custom headers for authentication and validation.
For further information on creating and configuring your events & actions, refer to Configure Events & Actions.