configuration
createChannel(options) takes more than an agent and adapters. This page
covers the configuration you reach for most. For the full option list, see the
Channel API.
Every channel runs through the Intelligence runtime, so running one requires a CopilotKit Intelligence key (free tier available) — for both managed and direct channels. See the Quickstart for the run pattern.
Identity and connection#
| Option | What it does |
|---|---|
name | Project-unique name. Required — the runtime keys the channel's lifecycle by it (and, for a managed channel, ties it to the dashboard setup). |
agent | The agent, or a (threadId) => agent factory. See the Quickstart. |
adapters | Direct platform adapters. Attach several to run one bot on many platforms. |
provider | For a no-adapter managed channel: the platform to declare to Intelligence. Defaults to "slack"; "teams" is gated. |
// A managed channel: Intelligence hosts the transport, so no adapter.
const channel = createChannel({
name: "support-bot",
agent,
});Per-thread state#
Give store.state a schema and thread.state() / thread.setState() become
typed to it and validated on write. Good for tracking where a conversation is
in a flow.
import { z } from "zod";
const channel = createChannel({
name: "support-bot",
agent,
store: {
state: z.object({ step: z.enum(["idle", "awaiting_approval"]) }),
},
});
channel.onMessage(async ({ thread }) => {
await thread.setState({ step: "awaiting_approval" }); // validated
const state = await thread.state(); // { step: "idle" | "awaiting_approval" } | undefined
});The rest#
| Option | See |
|---|---|
tools, context | Tools and context |
components | UI library |
commands | Commands and reactions |
store.adapter (durable backend) | Persistence |
store.identity + store.transcripts | Transcripts |