Loading...
Loading...
Use when migrating a CopilotKit v1 application to v2 -- updating package imports, replacing deprecated hooks and components, switching from GraphQL runtime to AG-UI protocol runtime, and resolving breaking API changes.
npx skill4agent add copilotkit/skills copilotkit-upgradecopilotkit-docssearch-docssearch-code.mcp.json@ag-ui/client@ag-ui/core@copilotkit/*@copilotkit/*@copilotkit/react-core -> hooks, CopilotKit provider, types
@copilotkit/react-ui -> CopilotChat, CopilotPopup, CopilotSidebar
@copilotkit/react-textarea -> CopilotTextarea (removed in v2)
@copilotkit/runtime -> CopilotRuntime, service adapters, framework integrations
@copilotkit/runtime-client-gql -> GraphQL client, message types
@copilotkit/shared -> utility types, constants
@copilotkit/sdk-js -> LangGraph/LangChain SDK| v1 API | v2 Replacement |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Removed -- use standard textarea + |
references/v1-to-v2-migration.md@copilotkit/*@copilotkit/react-core -> @copilotkit/react (consolidated into one package)
@copilotkit/react-ui -> @copilotkit/react (consolidated into one package)
@copilotkit/react-textarea -> removed (no v2 equivalent)
@copilotkit/runtime -> @copilotkit/runtime (same package, new agent-based API)
@copilotkit/runtime-client-gql -> removed (replaced by AG-UI protocol, re-exported from @copilotkit/react)
@copilotkit/shared -> @copilotkit/shared (same package)
@copilotkit/sdk-js -> @copilotkit/agent (new package for agent definitions)CopilotRuntimeCopilotRuntimeAbstractAgentimport { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";
const runtime = new CopilotRuntime({ actions: [...] });
// used with copilotKitEndpoint() for Next.js, Express, etc.import { CopilotRuntime, createCopilotEndpoint } from "@copilotkit/runtime";
import { BuiltInAgent } from "@copilotkit/agent";
const runtime = new CopilotRuntime({
agents: { myAgent: new BuiltInAgent({ model: "openai:gpt-4o" }) },
});
const app = createCopilotEndpoint({ runtime, basePath: "/api/copilotkit" });import { CopilotKit } from "@copilotkit/react-core";
<CopilotKit runtimeUrl="/api/copilotkit">
{children}
</CopilotKit>import { CopilotKitProvider } from "@copilotkit/react";
<CopilotKitProvider runtimeUrl="/api/copilotkit">
{children}
</CopilotKitProvider>| Concept | v1 | v2 |
|---|---|---|
| Package scope | | |
| Protocol | GraphQL | AG-UI (SSE) |
| Provider component | | |
| Define frontend tool | | |
| Share app state | | |
| Agent interaction | | |
| Handle interrupts | | |
| Render tool calls | | |
| Chat suggestions | | |
| Runtime class | | |
| Endpoint setup | | |
| Agent definition | | |
| Chat components | | |