Skip to content
ChatJS
Esc
↑↓navigate↵open⌘Jpreview
On this page

Config Reference

Source-owned installation and chat.config.ts runtime configuration

lib/config-schema.ts composes the core configuration contract with schemas contributed by installed tools. ConfigInput accepts overrides, while Config describes the parsed result with defaults. Import those types from your installed source instead of copying a parallel schema:

import type { Config, ConfigInput } from "@/lib/config-schema";

export type AppConfiguration = Config;
export type AppConfigurationInput = ConfigInput;
export type AiConfiguration = Config["ai"];

Use config from @/lib/config for runtime access. See Configuration for a complete input example.

Installation contract

Source Ownership
chatjs/providers/gateway.ts Installed gateway implementation
chatjs/providers/gateway-defaults.ts Gateway discriminator, defaults, capabilities and environment requirements
chatjs/providers/storage.ts, chatjs/providers/storage-options.ts Installed Files SDK adapter, non-secret options and credential requirements
chatjs/tools/*/chatjs.json Installed tool requirements, registration names, exclusive provider slots and document kinds
chatjs/tools/*/configuration-schema.ts Tool-owned validation and defaults
chatjs/generated/installed-config.ts Generated composition of installed tool schemas
chatjs/generated/documents.ts, document-ui.ts Separate shared document definitions and browser views, including assistant actions
chatjs/generated/tool-definitions.ts Browser-safe tool schemas and display metadata
chatjs/generated/providers.ts Shared search, retrieval, media and code-execution provider registrations
integrations/tools/execution.ts, integrations/tools/ui.ts User-authored tool and renderer registrations
chatjs/plugins/*/chatjs.json, generated plugin registrations Installed uploads, MCP and telemetry contributions

Tools can declare requiresTools, requiresGateway (image or video) and requiresStorage. Plugins can declare requiresPlugins and requiresStorage. Provider slots and document kinds are exclusive. The planner validates the complete resulting installation, including existing tools during replacement. Declared external capabilities still need adapter and lifecycle tests.

AI policy

Input Meaning
ai.gateway Literal discriminator of the installed gateway, not a provider switch
ai.curatedDefaults, disabledModels Model menus and access policy
ai.providerOrder Provider ordering in the model selector
ai.workflows.chat, title, pdf, chatImageCompatible Shared workflow model defaults
ai.tools.followupSuggestions.enabled, .default Follow-up generation policy and model
ai.tools.text.polish, code.edits, sheet.format, sheet.analyze Document model defaults
ai.tools.image.default, video.default Optional media model defaults for a capable gateway
ai.tools.deepResearch.defaultModel, finalReportModel Research model defaults
ai.tools.deepResearch.allowClarification Clarification policy
ai.tools.deepResearch.maxResearcherIterations Integer from 1 through 10
ai.tools.deepResearch.maxConcurrentResearchUnits Integer from 1 through 20
ai.tools.deepResearch.maxSearchQueries Integer from 1 through 10

Tool-specific entries in this table exist only when their owning tool is installed. followupSuggestions remains core. Unknown or uninstalled tool options are rejected instead of silently ignored. Gateway roles (smart, balanced, fast, image, video) supply defaults. You still override a tool through ai.tools in chat.config.ts.

Search, retrieval, execution, media and research availability come from installed source. They have no enabled input. Built-in gateway choices are Vercel, OpenRouter, OpenAI, OpenAI Compatible and LiteLLM. External gateway registry items supply their own discriminator and defaults. Model IDs and upstream availability must be checked with the selected provider.

Application policy

Input Meaning
features.parallelResponses Enable multiple independent responses, defaults to true
authentication.github, .google, .vercel OAuth provider toggles with matching credentials
attachments.maxBytes, .maxDimension, .acceptedTypes Core limits for uploads, message validation and attachment restoration
appName, appTitle, appPrefix, appDescription, appUrl Product identity and URLs
organization, services, legal, policies Contact details and legal/service disclosures
pricing Optional currency and free/pro pricing display content

Pricing text does not configure payment processing. Guest access limits do not replace a verified retention schedule.

Environment validation

bun run check-env checks base application credentials, the installed gateway/storage/tool/feature requirements and enabled OAuth providers. It also runs before development and production builds. A search installation requires its selected provider’s key. Setting the other search provider’s key does not change the installed implementation.

For example, a minimal app omits MCP, uploads, tools and telemetry and needs no credentials for those absent capabilities. Adding MCP requires MCP_ENCRYPTION_KEY even before a connector is configured. See Configuration for installation and replacement commands.

Guest model and rate limits belong to Guest Chat in chatjs/plugins/guest-chat/guest-policy.ts. Core has no anonymous model or quota settings.

Last updated on Nov 8, 2026

Was this page helpful?