FluxyChat

Platform

IoT

HTTP ingest and device shadow — not MQTT.

Devices POST JSON to the Worker. Readings fan out as room server_event name iot.reading. There is no native MQTT transport.

npx @fluxy-chat/create-fluxy-chat@latest my-iot --example iot-panel

Keep the app tab open, then:

curl -X POST "$WORKER/rooms/$ROOM/iot/events" \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{"deviceId":"sim-1","eventType":"telemetry","payload":{"temp":21}}'

Register a device (JWT). The Worker returns apiKey once (iot_…). Devices ingest with that key, not a member JWT. Shadow and rules still use the project JWT.

curl -X POST "$WORKER/iot/devices" \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{"name":"probe","roomId":"YOUR_ROOM"}'

curl -X POST "$WORKER/iot/devices/DEVICE_ID/readings" \
  -H "Authorization: Bearer $IOT_DEVICE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sensor":"temp","value":21,"unit":"C"}'

Quota: 5,000 readings per project per UTC day. Over that: HTTP 429 quota_exceeded. MQTT does not run in the Worker.

React

useChat({
  roomId,
  onServerEvent: (ev) => {
    if (ev.name === "iot.reading") { /* ev.data.sensor, ev.data.value */ }
  },
});

SDK: createWorkerFluxyIoTClient(client) for register/ingest/shadow.

On this page