Thuum Playground

Publish events, set states and subscribe, live. Every frame on the wire and the code that does it, in @thuum/client, plain browser JavaScript and Node.js.

Event Broker: connecting… State Broker: connecting…

Publish an event: it is stored for catch-up and delivered to everyone subscribed to the topic or to one of its super topics. Needs P. pub

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).eventBroker.connect();
await socket.ready;

const { id, ts } = await socket.pub('playground:35uqgpusfg', 'greeting', { "text": "Hello from the Playground" });

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.