Skip to content

Configuration

Proto reads proto.config.ts from your app root using defineProtoConfig from @protohq/cli/config. The table below is generated from protoConfigSchema.

Source

Proto reads proto.config.ts from your app root using defineProtoConfig from @protohq/cli/config. The table below is generated from protoConfigSchema.

KeyTypeDefaultDescription
stories.roots[].idstring(required)Unique lowercase identifier for a mounted Storybook story root.
stories.roots[].titlestring(optional)Optional display title for the story root in the gallery sidebar.
stories.roots[].dirstring"."Directory for the story root, relative to the app root.
stories.roots[].storiesstring or string[](required)Glob or list of globs locating story files inside dir.
stories.roots[].previewstring(required)Path to the Storybook preview module for this story root.
stories.roots[].vitestring(required)Path to the Vite config used to render stories in this root.
stories.roots[].static[].fromstring(required)Source directory of static assets served for the story root.
stories.roots[].static[].tostring(required)Mount path where those static assets are served.
stories.roots[].themeGlobalstring"theme"Storybook global name synchronized with the shell theme toggle.
stories.roots[].guards.forbidRuntimeImports(string | RegExp)[](optional)Optional per-root list of forbidden runtime import matchers for stories.
titlestring(required)Gallery title shown in the header, browser tab, and project home.
prototypesstring or string[]"src/**/*.proto.tsx"Glob or list of globs matching component and draft prototype files.
draftsstring"src/drafts"Directory for free-form exploration drafts inside the prototypes glob.
flowsstring"flows"Directory containing <id>.flow.ts user-journey definitions.
canvasstring"proto.canvas.tsx"File exporting Canvas (providers and CSS) and optional Frame chrome.
specsRecord<string, string> | ((root: string) => Record<string, string> | null)(optional)Map of { id: label } spec groups, or a Node function returning that map or null.
rolesRecord<string, string>{}Map of { id: label } preview roles offered in the shell role picker.
siteUrlstring (URL)(optional)Origin used to resolve relative paths on external flow nodes.
locale"en" | "pt-BR""en"Gallery shell language (en or pt-BR).
guards.forbidRuntimeImports(string | RegExp)[][]Module paths, prefixes, globs, package names, or RegExp patterns forbidden in prototypes, drafts, and stories.
guards.productionBoundarybooleantrueFail the production app build when prototype-only modules reach the production bundle.
evidence.dirstring"docs/design"App-relative output directory for proto screenshot and proto evidence artifacts.
build.includeReviewbooleanfalseInclude local review comments and status in static proto build output.
dev.pollbooleanfalseUse a polling file watcher for prototypes and config.
dev.allowedHostsstring[][]Extra hostnames (without ports) permitted to access this project's gallery URLs.

Environment overrides

  • PROTOHQ_PORT: chooses Proto's shared local port (default 4400, remembered between starts). Stop Proto before changing the port.
  • PROTOHQ_POLL=1: enables polling file watching (dev.poll).
  • PROTOHQ_TOKEN: supplies a CLI session token for hosted commands or CI.
  • PROTOHQ_WORKSPACE: selects the active Proto Cloud workspace slug.
  • PROTOHQ_API_URL: overrides the API origin for loopback development or https://staging-api.protohq.design.

See CLI and configuration, command catalog, and the JSON Schema. Run proto check to validate functions, regular expressions, and cross-field rules that JSON Schema cannot express.