Skip to main content
A space is a conversation — a DM, a group chat, a terminal session. A user is a participant identified by a platform-specific ID. Both carry a __platform tag so the narrowing functions from platform narrowing can recover their platform-specific shapes.

Space

Every exposes the same interface regardless of platform:
Provider-specific constraints surface as an .

User

Every has a platform-specific ID and platform tag.
Resolve a user from a platform-specific identifier through a narrowed platform instance:
The returned user may include additional platform-specific fields when the provider defines a user.schema.

Typing indicators

Manual

These are sugar for space.send(typing("start")) and space.send(typing("stop")) — see Typing indicators for the canonical form.

Automatic with responding

responding is the recommended pattern. It guarantees the typing indicator is cleared even if the inner function throws:
The helper is also available on the app itself:

Creating a space

To start a new conversation, use platform narrowing to get a platform instance, then call space.create(...) with the users:
To look up an existing conversation by its platform ID, use space.get(id):
The returned space is the platform-specific type — so you can read extra fields like type: "dm" | "group" on iMessage — but it also satisfies the generic interface, so send(), startTyping(), and friends are always available.