Event Broker: connecting… State Broker: connecting…
Create or replace a state's value. Every subscriber is notified. Needs P. set
Transport
Ctrl+Enter or ⌘+Enter in a field
Result
Run an action to see its reply here.
Subscribed
Not subscribed to anything.
import { ThuumClient } from '@thuum/client';
// Your server's token route: it keeps the App Key, the browser gets a short-lived token.
const { token } = await fetch('/apps/playground/token').then((r) => r.json());
const thuum = new ThuumClient({ baseUrl: 'https://api.thuum.dev' });
const socket = thuum.domain('thuum-apps', token).stateBroker.connect();
await socket.ready;
const { value, version } = await socket.set('playground:en1bod8for', 'status', { "online": true, "mood": "curious" });Runs in the browser. The token route belongs to your server, which keeps the App Key.
Anyone with this page's link can see and change this sandbox, and its data expires on its own. Don't put anything private here.