Every platform provider exports a callable —Documentation 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.
imessage, terminal, whatsappBusiness — that narrows generic Spectrum types into platform-specific ones. The same function handles three different inputs.
Narrowing the app
Pass aSpectrum instance to get a for that platform. The instance gives you user() and space() resolvers, plus access to any custom events the provider emits.
providers, the type of imessage(app) resolves to never — the call is a compile-time error.
Narrowing a space
Pass an existing space to access platform-specific fields:message.platform (or a similar signal) first.
Narrowing a message
Same idea for messages — useful when a provider declares amessage.schema to attach extra properties:
Creating group conversations
Thespace() method accepts multiple users. On iMessage:
params argument for extra space creation options — the shape of those params is defined per-provider through space.params on the platform definition.
Why narrowing matters
The genericSpace and Message interfaces are deliberately small — just enough to send, react, and reply across every platform. Narrowing is the escape hatch for everything else: typed access to iMessage chat types, WhatsApp phone numbers, or any extra field your custom platform exposes.