- channels decide how messages enter the app
- integrations are end-user connections the app can ask for at runtime
- secrets are app-owned credentials
Worked example
Here is what they look like when combined in one app:- answer in built-in chat and Telegram because of the channel binding
- read the operator’s model key because of the secret injection
- ask each end user to connect Gmail when the product needs mailbox access
Channels
Channel / ChannelRef
cpsl.Channel("name") references a named channel resource created through the CLI or dashboard.
Chat
cpsl.Chat() represents the built-in web chat. It exists mainly for backward compatibility because web chat is enabled implicitly.
API
cpsl.API() represents synchronous request/response access.
Deprecated inline channel classes
These still exist but are deprecated:cpsl.Telegram(...)cpsl.Slack(...)cpsl.WhatsApp(...)
cpsl.Channel("name").
Integrations
Declare integrations withapp.add_integration(...).
OAuth integrations
Secret-based integrations
awstailscale
fields=[...].
Reading an integration at runtime usually looks like this:
IntegrationCredentials
At runtime, connected credentials appear on session.integrations.
Fields
| Field | Meaning |
|---|---|
access_token | OAuth bearer token or empty for secret-form integrations |
token_type | Usually "Bearer" |
scopes | Granted scopes |
expires_at | Expiry timestamp when available |
fields | Submitted secret-form fields such as AWS keys |
Secret API
Secret.from_name(name)
Creates a secret reference.
secret.value
Resolves the runtime value:
- app-owned API keys
- OAuth client credentials
- channel credentials
Prompting helpers
These are the most important runtime entry points:await session.prompt_integration(type, reason="", timeout=...)await session.show_integration(type, reason="")