Actions2
Overview
This node integrates with Mercure APIs to either publish messages to specified topics or retrieve subscriber details. It is useful in real-time applications where you want to broadcast messages to multiple subscribers or manage subscriber tokens. For example, you can use it to send notifications to clients subscribed to certain topics or to generate tokens for subscribers to connect securely.
Use Case Examples
- Publishing a message to multiple topics to notify subscribers about an event.
- Generating a subscriber token to allow a client to listen to specific topics securely.
Properties
| Name | Meaning |
|---|---|
| Topics | Comma separated list of topics to which the message will be published or for which subscriber details are requested. |
| Message | The message content to be published to the specified topics. Required only for the publish operation. |
Output
JSON
url- The Mercure hub URL for subscriber operation.token- The JWT token generated for subscriber authentication.topics- The list of topics associated with the subscriber token.id- The response ID from the Mercure hub after publishing a message.
Dependencies
- Mercure API credentials including host URL, subscriber JWT key, and publisher JWT key
Troubleshooting
- Ensure that the Mercure credentials (host, subscriber JWT key, publisher JWT key) are correctly configured; otherwise, authentication will fail.
- If the node throws an error during HTTP request, check network connectivity and the validity of the JWT tokens.
- When publishing, ensure the message and topics are correctly set; an empty message or invalid topics may cause the request to fail.
Links
- Mercure Documentation - Official documentation for Mercure real-time protocol and hub.