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 aDocumentation Index
Fetch the complete documentation index at: https://docs.photon.codes/docs/llms.txt
Use this file to discover all available pages before exploring further.
__platform tag so the narrowing functions from platform narrowing can recover their platform-specific shapes.
Space
Every exposes the same interface regardless of platform:| Method | Description |
|---|---|
send(...content) | Send one or more content items into the conversation. |
startTyping() | Show a typing indicator. No-op if the platform doesn’t support it. |
stopTyping() | Hide the typing indicator. |
responding(fn) | Start a typing indicator, run fn, and stop the indicator when it completes — even if fn throws. |
User
Users are minimal: an ID and a platform tag.user.schema.
Typing indicators
Manual
space.send(typing("start")) and space.send(typing("stop")) — see Content 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:
Creating a space
To start a new conversation, use platform narrowing to get a platform instance, then pass the users:type: "dm" | "group" on iMessage — but it also satisfies the generic Space interface, so send(), startTyping(), and friends are always available.