<CopilotKit />
Provides the Copilot context to its children.
![](https://static.scarf.sh/a.png?x-pxid=a9b290bb-38f9-4518-ac3b-8f54fdbf43be)
This component provides the Copilot context to its children.
It can be configured either with a chat API endpoint or a CopilotApiConfig
.
The backend can use OpenAI, or you can bring your own LLM. For examples of the
backend api implementation, see examples/next-openai
or the runtime
docs.
Example usage
<CopilotKit publicApiKey="the api key or self host (see below)">
<App />
</CopilotKit>
Props
publicApiKey
string
Your Copilot Cloud API key.
cloudRestrictToTopic
{ validTopics?: string[]; invalidTopics?: string[]; }
Cloud feature: Restrict input to a specific topic.
runtimeUrl
string
the endpoint for the Copilot Runtime instance.
headers
Record<string, string>
Additional headers to be sent with the request.
For example:
{
'Authorization': 'Bearer your_token_here'
}
body
Record<string, any>
Additional body params to be sent with the request For example:
{
'message': 'Hello, world!'
}
children
ReactNode
requiredThe children to be rendered within the CopilotKit.
backendOnlyProps
Record<string, any>
Backend only props that will be combined to body params to be sent with the request For example:
{
'user_id': 'users_id',
}