Skip to content
OpenPulseDocs

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#

ImportUse it for
@openpulse/sdkconnect, lanes, defineExtension, errors. Servers read OPENPULSE_REALM_KEY.
@openpulse/sdk/browserThe same for browsers; connect({ getToken }) with seats.
@openpulse/sdk/serverissueSeat: tenant-scoped seats from your backend.
@openpulse/sdk/authopenpulseAuth, createVerifier: sign-in for web apps (server only).
@openpulse/sdk/auth/nextopenpulseProxy for Next.js.
@openpulse/sdk/reactHooks for sessions and lanes
@openpulse/sdk/bindShared documents (CRDT); also /bind/yjs and /bind/tiptap
@openpulse/sdk/bind/liveDocument presence for people and their agents, and live agent edits
@openpulse/sdk/roomsOpenPulseRooms: video rooms, join links, recording
@openpulse/sdk/messagingMessaging helpers: seats and message writes on the chat preset
@openpulse/sdk/advancedRuntimes, adapters and raw transport, when the everyday surface is not enough
@openpulse/sdk/paycreatePay: wallets and payments
@openpulse/sdk/mailOpenPulseMail: sending, templates, broadcasts, webhooks

The session#

CallReturns
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#

OptionMeaning
tokenA 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
relayPin a relay. Default: the nearest edge. Do not pin in browsers.
tenantFence the session to one tenant (defaults to the seat’s first)

The CLI#

Shell
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