CopilotKit

The CopilotKit provider component, wrapping your application.

This is the v1 provider, re-exported for back-compat

<CopilotKit> is the v1 provider. It is re-exported from @copilotkit/react-core/v2 so that a v1 application keeps working after the import path changes, and it renders <CopilotKitProvider> internally. The v2 provider is <CopilotKitProvider>. Reach for that one in new v2 code.

<CopilotKit> and <CopilotKitProvider> use different props to name the agent:

v1 <CopilotKit>v2 <CopilotKitProvider>
Name the agentagent="my_agent"agentId="my_agent"

You can also name the agent per chat with <CopilotChat agentId="my_agent">, or for a subtree with <CopilotChatConfigurationProvider agentId="my_agent">. Both of those override the provider-level default. See Provider and handler pairs.

Both providers treat an omitted useSingleEndpoint the same way: the transport is negotiated from the Runtime info response. Versions before 1.69.0 pinned <CopilotKit> to the single-route transport.

This component will typically wrap your entire application (or a sub-tree of your application where you want to have a copilot). It provides the copilot context to all other components and hooks.

Example

To host the runtime yourself, see Copilot Runtime.

import { CopilotKit } from "@copilotkit/react-core/v2";

<CopilotKit runtimeUrl="<your-runtime-url>">// ... your app ...</CopilotKit>;

Properties

Prop

Type

How is this guide?

On this page