Reference
SDK
The @openpulse/sdk entry points and what each one is for.
One package, @openpulse/sdk, holds everything: the library, Pay, Mail, Rooms and the openpulse CLI. Import the subpath you need; there is nothing else to install.
Entry points#
| Import | Use it for |
|---|---|
@openpulse/sdk | connect, lanes, defineExtension, errors. Servers read OPENPULSE_REALM_KEY. |
@openpulse/sdk/browser | The same for browsers; connect({ getToken }) with seats. |
@openpulse/sdk/server | issueSeat: tenant-scoped seats from your backend. |
@openpulse/sdk/auth | openpulseAuth, createVerifier: sign-in for web apps (server only). |
@openpulse/sdk/auth/next | openpulseProxy for Next.js. |
@openpulse/sdk/react | Hooks for sessions and lanes |
@openpulse/sdk/bind | Shared documents (CRDT); also /bind/yjs and /bind/tiptap |
@openpulse/sdk/bind/live | Document presence for people and their agents, and live agent edits |
@openpulse/sdk/rooms | OpenPulseRooms: video rooms, join links, recording |
@openpulse/sdk/messaging | Messaging helpers: seats and message writes on the chat preset |
@openpulse/sdk/advanced | Runtimes, adapters and raw transport, when the everyday surface is not enough |
@openpulse/sdk/pay | createPay: wallets and payments |
@openpulse/sdk/mail | OpenPulseMail: sending, templates, broadcasts, webhooks |
The session#
| Call | Returns |
|---|---|
connect(options?) | The shared session for this key or seat |
pulse.chat(id) | A chat room: publish, subscribe |
pulse.stream(id, preset?) | Any stream: publish, subscribe, write, end |
pulse.presence(room, options?) | Presence: set, clear, peers, onChange, close |
pulse.space(id, self) | A shared place with people and agents: participants, update, onChange |
pulse.events(scope?) | Fan-out events: publish, subscribe |
pulse.run() | The session’s AI answer stream |
pulse.onWake(handler) | Subscribe the default agent to wakes; returns unsubscribe |
pulse.agent(name) | A named agent with its own wakes and run |
pulse.triggers(scope) | The wake room underneath: emit, onTrigger |
pulse.pay.send(input) | Quote and send a payment (needs a step-up assertion) |
pulse.status() / onStatus() | live, degraded or auth-error, and how pushes arrive |
pulse.destroy() | Release this caller’s hold on the shared session |
Connect options#
| Option | Meaning |
|---|---|
token | A fixed bearer: a realm key or wire token. Default: OPENPULSE_REALM_KEY. |
getToken(force) | Where seats come from; called to connect, before expiry, and after a rejection |
relay | Pin a relay. Default: the nearest edge. Do not pin in browsers. |
tenant | Fence the session to one tenant (defaults to the seat’s first) |
The CLI#
openpulse start # guided setupopenpulse doctor --wire # checks your key and the connectionopenpulse env # prints the env your app needsopenpulse auth login --device # sign in on a headless machineopenpulse init --all # installs skills for coding agents