Custom Events
Custom events allow emitting and receiving data of any shape in a secure, end-to-end encrypted way.
Custom events allow you to send information to specific groups of users. The data will not be stored anywhere. For an event to reach the recipient, the recipient must be subscribed to the channel on which you are emitting the event at that moment.
Before working with Custom Events, follow our Getting Started Guide. It will show you how to set up your project to work with PrivMX Bridge.
Sample code on this page is based on the initial assumptions.
Working with Custom Events
Key Considerations
Please note the following:
- Events will only trigger for active connections.
- Events are not captured unless explicitly listened for.
- A single instance of the
eventQueue
is shared across all connections.
Emitting and Handling Custom Events
Below there is simple code example of how to emit an Event with the custom payload and then how to handle it when it arrives to the recipients.
A full code example can be found on Simplito's GitHub.
We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.
Handling Events
Events allow your application to respond to changes in user context instantly. These events are automatically captured when relevant changes occur. You can subscribe to them by registering event listeners.
Custom Fields and Queries
Using custom fields and querying them in Thread and Store containers.