# ChatJS Documentation > Complete documentation for ChatJS, the production-ready AI chat app. Learn authentication, streaming, tool calling, multi-model support, and deployment best practices. ## Get Started - [Introduction](https://chatjs.dev/docs): The building blocks for your AI app - [Quickstart](https://chatjs.dev/docs/quickstart): Get ChatJS running in minutes - [Project Structure](https://chatjs.dev/docs/project-structure): How ChatJS is organized - [Changelog](https://chatjs.dev/docs/changelog): Latest updates and announcements ## Concepts - [Architecture](https://chatjs.dev/docs/core/architecture): How ChatJS is structured and how data flows through the system - [Configuration & Extensions](https://chatjs.dev/docs/core/configuration): Install capabilities and configure runtime policy in ChatJS - [Source Ownership](https://chatjs.dev/docs/core/source-ownership): Know where to edit app code, installed source, and generated registrations - [Conversations](https://chatjs.dev/docs/core/conversations): Understand messages, turns, branches, and parallel responses - [Execution & Recovery](https://chatjs.dev/docs/core/execution): Understand creation, streaming, reconnecting, and cancellation - [Tool Calls & Approvals](https://chatjs.dev/docs/core/tool-calls): Understand tool availability, execution, results, and approval requests - [Identity & Access](https://chatjs.dev/docs/core/authentication): Understand account sessions, conversation ownership, and optional guest access ## Models & Gateways - [Models](https://chatjs.dev/docs/customization/models): Configure discovery, defaults, capabilities, and model visibility - [Reasoning](https://chatjs.dev/docs/core/reasoning): Extended thinking for supported models - [Prompts](https://chatjs.dev/docs/customization/prompts): Customize system prompts and AI behavior - [Overview](https://chatjs.dev/docs/gateways/overview): Route AI requests through a pluggable gateway abstraction - [Vercel Gateway](https://chatjs.dev/docs/gateways/vercel): Access 120+ AI models through Vercel AI Gateway - [OpenRouter Gateway](https://chatjs.dev/docs/gateways/openrouter): Access hundreds of AI models through OpenRouter - [OpenAI Gateway](https://chatjs.dev/docs/gateways/openai): Connect directly to the OpenAI API - [OpenAI Compatible Gateway](https://chatjs.dev/docs/gateways/openai-compatible): Connect to any OpenAI-compatible API endpoint - [LiteLLM Gateway](https://chatjs.dev/docs/gateways/litellm): Route requests through a LiteLLM proxy to access 100+ LLM providers - [Custom Gateway](https://chatjs.dev/docs/gateways/custom): Compose a ChatJS app with a third-party gateway registry item ## Tools - [Tools Overview](https://chatjs.dev/docs/tools/overview): Install and distribute typed ChatJS tools with shadcn registries - [Adding Tools](https://chatjs.dev/docs/tools/install): Install and register a tool in an existing ChatJS app - [Web Search](https://chatjs.dev/docs/tools/web-search): Real-time web search with citations - [Retrieve URL](https://chatjs.dev/docs/tools/retrieve-url): Extract structured content from a single web page through Firecrawl - [Deep Research](https://chatjs.dev/docs/tools/deep-research): Multi-step research agent with comprehensive reports - [Code Execution](https://chatjs.dev/docs/tools/code-execution): Secure Python and JavaScript sandbox for running code - [Generate Image](https://chatjs.dev/docs/tools/generate-image): Install image generation and editing through your selected AI gateway - [Generate Video](https://chatjs.dev/docs/tools/generate-video): Install video generation using your selected gateway and storage - [Documents & Canvas](https://chatjs.dev/docs/tools/canvas): Create and edit text documents, code, and spreadsheets - [Word Count](https://chatjs.dev/docs/tools/word-count): Count words, characters, and sentences in supplied text - [Get Weather](https://chatjs.dev/docs/tools/get-weather): Fetch current temperature and forecast data for coordinates - [Authoring Tools](https://chatjs.dev/docs/tools/authoring): Author native EVE tools and publish them as shadcn registry items ## Plugins - [Plugin catalog](https://chatjs.dev/docs/plugins/overview): Browse plugins for chat, integrations, analytics, and tracing - [Using Plugins](https://chatjs.dev/docs/plugins/using-plugins): Install and configure optional ChatJS capabilities - [Create a plugin](https://chatjs.dev/docs/plugins/create-plugin): Package source and register server, browser, and native contributions - [Projects](https://chatjs.dev/docs/plugins/projects): Organize conversations and share instructions across related chats - [Feedback](https://chatjs.dev/docs/plugins/feedback): Collect private ratings on assistant messages - [Search](https://chatjs.dev/docs/plugins/search): Find your chats by title and conversation text - [Model Preferences](https://chatjs.dev/docs/plugins/model-preferences): Let each user choose which models appear in the model picker - [AI Titles](https://chatjs.dev/docs/plugins/ai-titles): Automatically name new chats while preserving manual titles - [Credits](https://chatjs.dev/docs/plugins/credits): Gate spending and debit registered-user balances from durable usage evidence - [Guest Chat](https://chatjs.dev/docs/plugins/guest-chat): Offer disposable text conversations without creating accounts or saved chat history - [Desktop](https://chatjs.dev/docs/plugins/desktop): Add Electron authentication, browser handoff, and desktop navigation to your app - [Sharing](https://chatjs.dev/docs/plugins/sharing): Publish read-only conversations with revocable access - [Follow-up Suggestions](https://chatjs.dev/docs/plugins/followup-suggestions): Suggest related questions after an assistant answer - [MCP](https://chatjs.dev/docs/plugins/mcp): Connect Model Context Protocol servers to extend AI capabilities - [Attachments](https://chatjs.dev/docs/plugins/attachments): Upload images and PDFs from the chat composer - [Vercel Analytics](https://chatjs.dev/docs/plugins/vercel-analytics): Add Vercel Analytics to your application layout - [Vercel Speed Insights](https://chatjs.dev/docs/plugins/vercel-speed-insights): Add Vercel Speed Insights to your application layout - [Langfuse](https://chatjs.dev/docs/plugins/langfuse): Export server traces through Langfuse instrumentation ## Customization - [Authentication](https://chatjs.dev/docs/customization/authentication): Configure OAuth providers and sign-in behavior - [Theming](https://chatjs.dev/docs/customization/theming): Customize colors, fonts, and styling - [Fonts](https://chatjs.dev/docs/customization/fonts): Customize the typography of your ChatJS app - [Branding](https://chatjs.dev/docs/customization/branding): Replace icons, logos, and images for your app - [Syntax Highlighting](https://chatjs.dev/docs/core/syntax-highlighting): Beautiful code formatting with themes - [Chat Layout](https://chatjs.dev/docs/cookbook/chat-layout): Composable resizable main and secondary panel layout - [Component Registries](https://chatjs.dev/docs/cookbook/component-registries): Add shadcn and AI Elements components to your app - [Customizing Integrations](https://chatjs.dev/docs/cookbook/customize-integrations): Compose installed plugins and tools in app-owned integration modules ## Deployment - [Deployment](https://chatjs.dev/docs/deployment): Choose hosting and configure the database, file storage, and sandbox infrastructure for your app - [Database](https://chatjs.dev/docs/reference/database): PostgreSQL database management commands and schema workflow - [Sandboxes](https://chatjs.dev/docs/deployment/sandboxes): Configure sandbox infrastructure for EVE sessions and code execution - [Desktop Distribution](https://chatjs.dev/docs/deployment/desktop): Brand, package, and distribute your Electron companion ### Hosting - [Deploy to Vercel](https://chatjs.dev/docs/deployment/vercel): Production deployment with Vercel's integrated platform - [Docker](https://chatjs.dev/docs/deployment/docker): Container deployment requirements for ChatJS - [Self-Hosted](https://chatjs.dev/docs/deployment/self-hosted): Candidate deployment topology and ChatJS release acceptance requirements ### File Storage - [File storage](https://chatjs.dev/docs/storage): Configure provider-agnostic storage for attachments and generated media - [Custom Storage](https://chatjs.dev/docs/storage/custom): Publish a third-party storage integration using the standard ChatJS registry contract ## Guides - [Guides](https://chatjs.dev/docs/cookbook): Practical walkthroughs for tools and local development - [Custom Tool Part](https://chatjs.dev/docs/cookbook/tool-part): Render native EVE tool results with validated schema-inferred props - [Explicit Tool Selection](https://chatjs.dev/docs/cookbook/explicit-tool-selection): Carry a user-selected tool through the EVE gateway and native turn - [Neon Branching](https://chatjs.dev/docs/cookbook/neon-branching): Isolated database environments for safe schema development - [Development Auth Bypass](https://chatjs.dev/docs/cookbook/dev-auth-bypass): Auto-authenticate AI agents for browser testing - [Git Worktrees](https://chatjs.dev/docs/cookbook/git-worktrees): Parallel development environments without branch switching ## Reference - [Config Reference](https://chatjs.dev/docs/reference/config): Source-owned installation and chat.config.ts runtime configuration - [Plugin API](https://chatjs.dev/docs/reference/plugin-api): Typed server and client contracts for optional ChatJS capabilities - [Environment Variables](https://chatjs.dev/docs/reference/env-vars): Complete reference for all environment variables used by ChatJS - [URL Routing](https://chatjs.dev/docs/reference/routing): URL structure and pathname parsing utilities - [Testing](https://chatjs.dev/docs/reference/testing): Unit tests and end-to-end testing with Vitest and Playwright - [Evaluations](https://chatjs.dev/docs/reference/evaluations): Test and measure AI agent quality with Evalite ### CLI - [Overview](https://chatjs.dev/docs/cli): chat-js — scaffold and manage ChatJS applications - [create](https://chatjs.dev/docs/cli/create): Scaffold a new ChatJS application - [add](https://chatjs.dev/docs/cli/add): Install registry tools, plugins and providers - [config](https://chatjs.dev/docs/cli/config): Print the resolved configuration for the current ChatJS project - [status](https://chatjs.dev/docs/cli/status): Inspect installation file kinds, local edits, and plugin removal dependencies - [sync](https://chatjs.dev/docs/cli/sync): Regenerate typed tool, plugin, and router registrations - [remove](https://chatjs.dev/docs/cli/remove): Disconnect installed plugins while retaining database schemas and data ### Registry - [Registry Overview](https://chatjs.dev/docs/registry): Understand extension distribution, source ownership, and installation contracts - [Namespaces](https://chatjs.dev/docs/registry/namespaces): Identify registry sources independently of item categories and installed paths - [Authoring and Publishing](https://chatjs.dev/docs/registry/authoring): Publish tested TypeScript source through generated shadcn registry JSON - [Registry Mirror](https://chatjs.dev/docs/registry/mirror): Preview canonical registry changes in the ChatJS reference app - [Registry Validation](https://chatjs.dev/docs/registry/validation): Check dependency ownership and composed applications before running real installation tests - [Building and Testing](https://chatjs.dev/docs/registry/testing): Verify source behavior and the generated registry installation contract ### Standalone AI SDK - [Threads](https://chatjs.dev/docs/threads): Add branching conversations and parallel responses to your AI SDK app with @chat-js/thread - [Resumable Streams](https://chatjs.dev/docs/reference/standalone/resumable-streams): Continue AI responses after connection interruptions - [Stop Resumable Streams](https://chatjs.dev/docs/reference/standalone/stop-resumable-streams): Abort provider streams without breaking resume ### Contributing - [Desktop Release Process](https://chatjs.dev/docs/reference/desktop-releases): Repository maintainer reference for publishing Electron artifacts ## Agent skills - [check-visual-changes](https://chatjs.dev/docs/.well-known/agent-skills/check-visual-changes/SKILL.md): Check the visual impact of an edit mid-task with `uiverify check` — render just the components you're touching on the UI Verify fleet and diff them against the real CI baseline, without opening a PR, posting a check, or moving a baseline. Works for every capture method (Storybook, Playwright, Vitest archives, and raw screenshots). Use when a coding agent has changed UI and wants a fast, authoritative "would this pass" answer before pushing — "check my visual changes", "did I break anything visually", "preview this diff", "run uiverify check". Hands off to triage-visual-changes for the pixel review. - [create-vercel-ai-issue](https://chatjs.dev/docs/.well-known/agent-skills/create-vercel-ai-issue/SKILL.md): Create a well-formed GitHub issue in vercel/ai using the gh CLI. Use when reporting an AI SDK bug or preparing an issue body that contains logs, code blocks, versions, reproduction steps, and shell-sensitive text. - [dev-auth-bypass](https://chatjs.dev/docs/.well-known/agent-skills/dev-auth-bypass/SKILL.md): Authenticate a browser against a local ChatJS app without OAuth. Use for development login, local auth bypass, authenticated browser or Playwright testing, and the /api/dev-login route. - [economical-visual-tests](https://chatjs.dev/docs/.well-known/agent-skills/economical-visual-tests/SKILL.md): Author economical visual tests — full visual coverage in the fewest billable snapshots. Applies to any per-snapshot visual tool (UI Verify, Chromatic, Percy, Playwright screenshots), which all bill and diff per rendered story/test. Use when a component's variants/states are exploding into one snapshot per combination, when the visual-testing bill or noise is driven by snapshot count, or when writing new stories/captures and you want the cheapest layout that still covers every variant. Covers gallery/matrix stories, data-driven states, and the coarse-granularity tradeoff. - [generate-code-snippet](https://chatjs.dev/docs/.well-known/agent-skills/generate-code-snippet/SKILL.md): Generate a concise, shareable code snippet URL for code.franciscomoretti.com. Use when preparing a code image or short snippet for Twitter, X, social sharing, or a presentation. - [lazy-prefetch-pattern](https://chatjs.dev/docs/.well-known/agent-skills/lazy-prefetch-pattern/SKILL.md): Use the ChatJS React Query v5 lazy-prefetch pattern without blocking server rendering. Use when prefetching tRPC queries in Next.js Server Components or changing query dehydration and hydration behavior in apps/chat. - [making-ui-changes](https://chatjs.dev/docs/.well-known/agent-skills/making-ui-changes/SKILL.md): Read before changing any component, page, or styles. Five moves to change UI without silently breaking another screen - reuse before you create, cover every state, check the blast radius, prove it with a visual test, kill flake at the source. - [next-cache-components-adoption](https://chatjs.dev/docs/.well-known/agent-skills/next-cache-components-adoption.tar.gz): Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the `cacheComponents` flag, work through a flood of blocking-prerender / instant validation errors, run the `cache-components-instant-false` codemod, or decide between opting routes out with `export const instant = false` and fixing them in place. - [next-dev-loop](https://chatjs.dev/docs/.well-known/agent-skills/next-dev-loop/SKILL.md): Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines /_next/mcp (Next.js's view) with agent-browser (the browser's view). Requires a running `next dev`. - [next-partial-prefetching-adoption](https://chatjs.dev/docs/.well-known/agent-skills/next-partial-prefetching-adoption/SKILL.md): Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the `partialPrefetching` flag, opt routes in with `export const prefetch = 'partial'`, audit `` calls, or resolve the link-prefetch-partial and instant-shell-url-data insights. - [review-docs](https://chatjs.dev/docs/.well-known/agent-skills/review-docs/SKILL.md): Review and fix ChatJS Blume documentation and MDX files. Use when checking docs for correctness, broken links, stale examples, unclear prose, or consistency with the implementation. - [strategic-testing](https://chatjs.dev/docs/.well-known/agent-skills/strategic-testing/SKILL.md): Decide whether a change warrants new tests and choose proportionate verification. Use before adding tests, when planning validation, or when reviewing whether a proposed test protects meaningful behavior. - [triage-visual-changes](https://chatjs.dev/docs/.well-known/agent-skills/triage-visual-changes/SKILL.md): Triage a UI Verify build from your coding agent via the UI Verify MCP — bucket a build's changed stories into real regressions vs cosmetic reflow vs rendering noise, summarize the real regressions for a PR comment, and accept baselines in bulk. Use after a UI Verify build reports changes and you want the agent to review, summarize, or accept from the terminal instead of clicking through the dashboard. Triggers - "triage this build", "summarize the visual regressions", "accept all the new baselines". - [trpc-patterns](https://chatjs.dev/docs/.well-known/agent-skills/trpc-patterns/SKILL.md): Implement ChatJS tRPC routers, TanStack Query hooks, mutations, and cache invalidation. Use when adding or changing tRPC procedures or their React consumers in apps/chat. - [vitest-visual-testing](https://chatjs.dev/docs/.well-known/agent-skills/vitest-visual-testing/SKILL.md): Make @uiverify/vitest (Vitest browser-mode) captures deterministic so component visual tests stop coming back "changed" without a real change (flaky diffs). Use when setting up or debugging visual tests over Vitest browser-mode component tests, or rendering whole pages (including Next.js App Router pages) in browser mode. Focuses only on the run-to-run variation the capturer can't neutralize from outside your app — above all live/dynamic data, the highest-value step (freeze it with static fixtures and the whole content-noise class disappears), plus the clock, infinite JS animations, and non-Math.random randomness, and the one Vitest-specific trap - capturing before the component has settled. - [worktree-ports](https://chatjs.dev/docs/.well-known/agent-skills/worktree-ports.tar.gz): Discover and use stable per-app ports assigned to a local monorepo worktree. Use when starting, opening, testing, or debugging local apps, or when worktree slots, localhost ports, PORT, app URLs, or .worktree-env.json are involved. ## Agent resources - [llms-full.txt](https://chatjs.dev/docs/llms-full.txt): The full Markdown of every page in one file. - [Page Markdown](https://chatjs.dev/docs/index.md): Append `.md` to any page URL to fetch that page as raw Markdown. - [JSON API](https://chatjs.dev/docs/api/docs/pages.json): Page index of the JSON docs API; each entry links the page's JSON and Markdown forms. Described by the OpenAPI document at https://chatjs.dev/docs/openapi.json. - [Agent skills](https://chatjs.dev/docs/.well-known/agent-skills/index.json): Agent Skills discovery index of the skills this site publishes. - [API catalog](https://chatjs.dev/docs/.well-known/api-catalog): RFC 9727 linkset of the APIs documented here. - [agent-readability.json](https://chatjs.dev/docs/agent-readability.json): Manifest of every agent-facing artifact on this site. - [Sitemap](https://chatjs.dev/docs/sitemap.xml): Every indexable page URL with its last-modified date.