YourDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/alineacms/alinea/llms.txt
Use this file to discover all available pages before exploring further.
cms.ts (or cms.tsx) file is the single source of truth for your entire content model. Everything Alinea needs to know — which entry types exist, how they are organized, where files live on disk, and how the dashboard behaves — is declared here and passed to createCMS. The TypeScript types flow from this config directly into your query layer, so your editor autocomplete and runtime data stay in sync.
The Config object
createCMS from alinea/next accepts a plain object that satisfies the Config interface. Every field is type-checked at call time, and createCMS automatically validates cross-references — for example, that types named in contains arrays actually exist in the schema — at startup.
Shape of Config
createCMS automatically injects the CloudAuthView as the default auth
value and merges the built-in admin role into roles. You only need to
override these if you want custom behavior.Minimal example
The example below shows a complete, workingcms.ts for a Next.js project with two entry types and one workspace.
cms.ts
Config options reference
The assembled schema object returned by
Config.schema(). Contains all entry
type definitions and is the foundation for typed queries.A map of workspace keys to workspace objects created with
Config.workspace(). Every key must be a valid identifier ([A-Za-z0-9_]).Additional named roles for access control. Create roles with
Config.role(label, options), which accepts a permissions callback receiving a WriteablePolicy to define fine-grained allow/deny rules. An admin role with full access is always included automatically.When set to
true or a URL string, Alinea embeds a live-preview frame inside
the dashboard. Can also be configured per workspace or per root.When
true, every save creates a draft entry that must be explicitly
published before it appears to public queries.How often (in seconds) the dashboard polls the backend for content updates.
The public URL of your application. Used to construct entry preview URLs.
Supply an object to use different values per
NODE_ENV.The URL of the Alinea API route handler. Defaults to
/api/cms when using
createHandler from alinea/next.The folder where uploaded public assets are written. Passed through to the
file backend.
Filename of the generated dashboard HTML file. The dashboard is served at the
path derived from this name (e.g.
admin.html → /admin).The authentication view component rendered in the dashboard login screen.
Defaults to
CloudAuthView.Explore the configuration layers
The config is split into four closely related concepts. Read each guide to understand the full picture.Workspaces
Group roots together and point them at a source directory on disk.
Roots
Define the top-level entry points inside a workspace’s content tree.
Types & Fields
Describe the shape of every entry with typed field definitions.