Skip to main content
Messages are read over MQTT. Every topic has a read channel: subscribe to <topic ID>/out and the platform delivers the topic’s messages to your client as they arrive. The topic ID is on the topic card, for example u0123456789abcdef-orders, so the read channel is u0123456789abcdef-orders/out.
HTTP and HTTPS connections only publish: send a POST to the connection URL. Reading always goes through MQTT.

Connect

Use the MQTT or MQTTS broker URL from the topic card and a client ID that is unique for every session. Then authenticate in one of two ways.
Works with an account token or a consumer subaccount token.
The token is checked when the client connects. Get a fresh token for every new connection.
Premium endpoints use their own broker hostnames. Copy the exact URL from the topic card.

Example with MQTT.js

read.mjs

How delivery works

  • Delivery to /out runs while at least one client is subscribed. The first subscription can take a little while to start it.
  • When nobody is subscribed, the topic keeps the messages. Delivery resumes from where it stopped when a client subscribes again, as long as the topic still keeps those messages (seven days by default, see Plans and limits).
  • Messages are delivered to the clients subscribed at that moment.

Read more than one topic

Consumers can also read the topics you allowed in Read access:
  • SCRAM consumer credential: one connection can subscribe to <topic ID>/out of every allowed topic.
  • Access token: the username names one topic, so open one connection per topic, each with that topic’s ID as the username. A consumer subaccount reaches the topics you ticked under Also read from.
Two sessions with the same client ID disconnect each other. Give every session its own client ID.