| title | CopilotKit |
|---|---|
| description | The CopilotKit provider component, wrapping your application. |
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.
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>Don't have it yet? Go to https://dashboard.operations.copilotkit.ai and get one for free.
Your public license key for accessing Enterprise Intelligence Platform features.Don't have it yet? Go to https://dashboard.operations.copilotkit.ai and get one for free.
Restrict input to specific topics using guardrails. @remarksThis feature is only available when using CopilotKit's hosted cloud service. To use this feature, sign up at https://dashboard.operations.copilotkit.ai to get your publicApiKey. The feature allows restricting chat conversations to specific topics.
The endpoint for the Copilot Runtime instance. See the Copilot Runtime API documentation. The endpoint for the Copilot transcribe audio service. The endpoint for the Copilot text to speech service. Additional headers to be sent with the request.For example:
{
"Authorization": "Bearer X"
}Note: The authorization property is automatically forwarded to LangGraph agents. See the LangGraph Agent Authentication Guide (see code examples above) for details.
To enable HTTP-only cookie authentication, set credentials="include" and configure
CORS on your runtime endpoint:
// Frontend (https://myapp.com)
<CopilotKit runtimeUrl="https://api.myapp.com/copilotkit" credentials="include">
{children}
</CopilotKit>;
// Backend (https://api.myapp.com)
copilotRuntimeNextJSAppRouterEndpoint({
runtime,
endpoint: "/copilotkit",
cors: {
origin: "https://myapp.com",
credentials: true,
},
});Set to true to show error banners and toasts, false to hide all error UI.
Defaults to false for production safety.
The built-in A2UI renderer is activated automatically when the runtime reports
that a2ui is configured in CopilotRuntime. This prop is optional and only
needed if you want to override the default theme.
<CopilotKit runtimeUrl="/api/copilotkit" a2ui={{ theme: myCustomTheme }}>
{children}
</CopilotKit><PropertyReference name="forwardedParameters" type="Pick<ForwardedParametersInput, 'temperature'>"
The forwarded parameters to use for the task.
The auth config to use for the CopilotKit. @remarksThis feature is only available when using CopilotKit's hosted cloud service. To use this feature, sign up at https://dashboard.operations.copilotkit.ai to get your publicApiKey. The feature allows restricting chat conversations to specific topics.
The thread id to use for the CopilotKit. Optional error handler for comprehensive debugging and observability.Requires publicApiKey: Error handling only works when publicApiKey is provided. This is an Enterprise Intelligence Platform feature.
@param errorEvent - Structured error event with rich debugging context
@example
<CopilotKit
publicApiKey="ck_pub_your_key"
onError={(errorEvent) => {
debugDashboard.capture(errorEvent);
}}
>