REST API Endpoints
The Topic Registry provides REST API endpoints for programmatic access to topic data. This enables integration with other tools or services.
Important: REST API endpoints require a secret key for authentication, set via the NEXT_PUBLIC_X_LITMUS_KEY environment variable during deployment. Include this key in the request headers as X_LITMUS_KEY. The default value is change-me.
Available endpoints:
POST /api/subscribe: Subscribe to a specific topic to receive real-time updates. Provide the topic name as a query parameter:
You can set a timeout in milliseconds with the timeout parameter (maximum 60,000 ms):
Note: If the timeout is reached without any data being published, the subscription remains active. You can receive updates using the GET /api/value endpoint.
GET /api/value: Retrieve the last stored value of a topic:
These REST API endpoints provide a convenient way to access topic data programmatically, enabling seamless integration with external systems and services.
Tip: To get a list of real-time subscriptions, use:
This endpoint returns all active subscriptions and their topics.