What problem does it solve? Integrating a chat UI with a custom AI agent backend requires solving authentication, conversation history injection, page context passing, and httpOnly cookie handling—problems that cause silent failures like agents forgetting history or rejecting requests. ## Core Features & Use Cases - Custom ChatKit Backend: Extend ChatKitServer with a respond() method that loads conversation history, injects user and page context into the agent prompt, and streams responses. - Frontend Integration: Configure useChatKit with a custom fetch interceptor that adds auth headers and metadata, plus script loading detection for web components. - Auth Patterns: Handle JWT/JWKS verification, httpOnly cookie proxies via Next.js API routes with SSE streaming, and MCP tool authentication through system prompts. - Use Case: Add an authenticated AI assistant to a Next.js documentation site that knows which page the user is viewing and remembers the conversation across messages. ## Quick Start Ask the AI to build a ChatKit chat interface with a custom Python backend agent and a React frontend that injects user authentication and page context.