Mercure icon

Mercure

Consume Mercure APIs

Overview

This node integrates with Mercure APIs to either subscribe to topics or publish messages to topics. It is useful for real-time communication scenarios where you want to receive updates on specific topics or broadcast messages to subscribers. For example, you can use it to subscribe to live updates on a news feed or publish notifications to multiple clients.

Use Case Examples

  1. Subscribe to multiple topics to receive real-time updates on those topics.
  2. Publish a message to one or more topics to notify subscribers about an event.

Properties

Name Meaning
Topics Comma separated list of topics to subscribe to or publish messages to.

Output

JSON

  • url - The Mercure hub URL for subscriber operation.
  • token - The JWT token generated for subscriber authentication.
  • topics - The list of topics the subscriber is subscribed to.
  • id - The response ID from the publish operation indicating successful message publication.

Dependencies

  • Requires Mercure API credentials including host URL and JWT keys for subscriber and publisher authentication.

Troubleshooting

  • Ensure the Mercure credentials (host, subscriber JWT key, publisher JWT key) are correctly configured to avoid authentication errors.
  • If the node fails on a specific item, check the 'continue on fail' setting to handle errors gracefully.
  • Verify that the topics string is correctly formatted as a comma separated list to avoid token generation issues.

Discussion