CopilotKit

The CopilotKit provider component, wrapping your application.

Copy a prompt that guides your coding agent through CopilotKit setup.

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.

The two are not aliases: they name the agent with different props.

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.70.2 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

You can find more information about self-hosting CopilotKit here.

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

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

Properties

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type

Prop

Type