CopilotKitCoreConfig
Configuration object passed to the CopilotKitCore constructor.
Overview
CopilotKitCoreConfig is the configuration object accepted by the CopilotKitCore constructor. It wires the core to a CopilotRuntime endpoint and seeds it with frontend tools, suggestions, request headers, and forwarded properties.
Import
import type { CopilotKitCoreConfig } from "@copilotkit/core";Definition
interface CopilotKitCoreConfig {
runtimeUrl?: string;
runtimeTransport?: CopilotRuntimeTransport;
agents__unsafe_dev_only?: Record<string, AbstractAgent>;
headers?: Record<string, string>;
credentials?: RequestCredentials;
properties?: Record<string, unknown>;
tools?: FrontendTool<any>[];
suggestionsConfig?: SuggestionsConfig[];
debug?: DebugConfig;
}Properties
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Usage
import { CopilotKitCore } from "@copilotkit/core";
import { z } from "zod";
const copilotkit = new CopilotKitCore({
runtimeUrl: "/api/copilotkit",
headers: { Authorization: "Bearer token" },
properties: { userId: "user_123" },
tools: [
{
name: "sayHello",
description: "Greet the user",
parameters: z.object({ name: z.string() }),
handler: async ({ name }) => `Hello, ${name}!`,
},
],
});