Files
copilotkit__copilotkit/examples/showcases/arcade-tools/app/providers.tsx
Thierry Damiba 8143df4da8 docs(cookbook): add Arcade authenticated-tools recipe and showcase
Adds a cookbook recipe + runnable showcase that gives the Built-in Agent
OAuth-backed Arcade tools (Gmail, Google News) and renders Arcade's one-time
authorization step as a generative-UI "Connect" card in the chat.

- docs: showcase/shell-docs/src/content/docs/cookbook/arcade.mdx (+ meta.json, index card)
- app: examples/showcases/arcade-tools (Next.js App Router, single-route runtime)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 23:37:48 -07:00

29 lines
952 B
TypeScript

"use client";
import { CopilotKit } from "@copilotkit/react-core/v2";
import "@copilotkit/react-core/v2/styles.css";
import type { ReactNode } from "react";
/**
* The v2 provider must be mounted from a Client Component. It opens the AG-UI
* event stream to our runtime route and gives every CopilotKit hook/component
* below it access to the agent.
*/
export function Providers({ children }: { children: ReactNode }) {
return (
<CopilotKit
runtimeUrl="/api/copilotkit"
// Single-route transport: the client POSTs every call as a { method, params,
// body } envelope to runtimeUrl. Must match the runtime route's
// mode: "single-route" handler (see app/api/copilotkit/route.ts).
useSingleEndpoint
onError={(event) => {
// Surfacing errors keeps the chat from getting stuck on "connecting…".
console.error("[copilotkit]", event);
}}
>
{children}
</CopilotKit>
);
}