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
The endpoint of the CopilotRuntime.
Transport style for CopilotRuntime endpoints. "auto" probes REST and falls back to single-route.
Mapping from agent name to its AbstractAgent instance. For development only — production requires a CopilotRuntime.
Headers appended to every HTTP request made by CopilotKitCore.
Credentials mode for fetch requests (e.g. "include" for HTTP-only cookies).
Properties sent as forwardedProps to the AG-UI agent.
Ordered collection of frontend tools available to the core.
Suggestions configuration for the core.
Enable debug logging for the client-side event pipeline.
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}!`,
},
],
});