Configuration
Complete nexus.config.ts reference — every option and what lives elsewhere.
nexus.config.ts (also .mjs / .js / .json) is loaded by the CLI
(generate / watch / check / doctor). Use defineConfig from
@nexus-cms/core for typing.
import { defineConfig } from "@nexus-cms/core";
export default defineConfig({
include: ["app/**/*.{tsx,jsx}", "components/**/*.{tsx,jsx}"],
exclude: ["**/node_modules/**", "**/*.test.*", "**/*.stories.*"],
schemaOutput: ".nexus/cms-schema.json",
locales: ["en"],
breakpoints: [375, 768, 1280],
features: {
text: true,
image: true,
link: true,
visibility: true,
collectionReorder: true,
collectionAddRemove: true,
seo: true,
versions: true,
locales: true,
},
naming: {
stripSuffixes: ["Section"],
overrides: { Hero: "Hero banner" },
},
backend: {
adapter: "filament",
baseUrl: process.env.NEXT_PUBLIC_NEXUS_API_URL,
projectKey: process.env.NEXT_PUBLIC_NEXUS_PROJECT,
tokenEnv: "NEXUS_API_TOKEN",
syncIntervalSeconds: 600,
},
licenseKey: process.env.NEXUS_LICENSE_KEY,
});Options in nexus.config.ts
Scan & schema
| Option | Default | What it does |
|---|---|---|
include | app/**/*.{tsx,jsx}, src/**/*.{tsx,jsx}, components/**/*.{tsx,jsx} | Globs the CLI scans for editable regions. |
exclude | **/node_modules/**, **/*.test.*, **/*.stories.* | Extra globs skipped (on top of // @cms-ignore). |
schemaOutput | .nexus/cms-schema.json | Where nexus generate writes the schema. |
Locales & layout hints
| Option | Default | What it does |
|---|---|---|
locales | ["en"] | Site locales. First entry is the default. |
breakpoints | [375, 768, 1280] | Documented viewport widths for overlay layout. Accepted in config today; not yet consumed by the runtime overlay. |
features (all default true)
Compiler still emits regions when a flag is off — only the editor is gated.
| Flag | When false |
|---|---|
text | Text / richtext regions are not editable. |
image | Image swap / upload disabled. |
link | Link label/href editing disabled. |
visibility | Show/hide toggles hidden. |
collectionReorder | Collection reorder controls hidden. |
collectionAddRemove | Add/remove items hidden (also Pro-licensed). |
seo | SEO panel hidden. |
versions | Versions panel hidden (also Pro-licensed). |
locales | Locale switcher / i18n editing hidden (also Pro-licensed). |
License still gates Pro flags via applyLicenseToFlags even if config sets them true.
naming
| Option | What it does |
|---|---|
stripSuffixes | Strip these suffixes from component names when deriving region labels (e.g. "Section" → Hero from HeroSection). |
overrides | Map ComponentName → display name (e.g. { Hero: "Hero banner" }). |
backend
| Option | Default | What it does |
|---|---|---|
adapter | — | "filament" | "http" | "memory" (declared intent for tooling / docs). |
baseUrl | — | Backend API base URL. |
projectKey | — | Project id on the backend. |
tokenEnv | "NEXUS_API_TOKEN" | Name of the env var holding the server token (never inlined to the client). |
syncIntervalSeconds | 600 | Hint for client background refetch interval. |
Wiring the actual adapter is still done in app code (
createHttpAdapter/createMemoryAdapter+<CmsProvider>/<NexusProvider>). Config alone does not mount storage.
License
| Option | Default | What it does |
|---|---|---|
licenseKey | — | Key from the Dashboard (e.g. NEXUS-PRO-…). Selects feature tier. |
Not configured in nexus.config.ts
These are controlled elsewhere:
JSX comment directives (source)
| Directive | Where | Effect |
|---|---|---|
// @cms-ignore | File top | Skip entire file. |
// @cms-readonly | File top | Regions discovered but not editable. |
// @cms-name(…) | File top | Override auto-derived page/section name. |
// @cms-locales(en,ar) | File top | Per-file locale set. |
{/* @cms-ignore */} | Above element | Skip that node. |
{/* @cms-readonly */} | Above element | Region read-only. |
{/* @cms-name(…) */} | Above element | Region display name. |
{/* @cms-richtext */} / {/* @cms-unite */} | Above element | One text field (collapse Highlighter/motion splits). |
{/* @cms-section */} | Above element | Hideable page section (also auto for <section> / <article>). |
{/* @cms-layout(bento|alternating|stack|grid) */} | Above collection | How cloned items inherit layout classes. |
See Comment directives.
<CmsProvider> / <NexusProvider> props (runtime)
| Prop | Notes |
|---|---|
schema | Loaded JSON from schemaOutput. |
adapter | Concrete storage (memory / HTTP / Filament client). |
page | Current route key (e.g. "/"). |
editMode | Overlay on/off (often ?edit=1). |
initialContent | SSR no-flash content. |
locale | Initial locale. |
features / licenseKey / syncIntervalSeconds | Can override config at runtime. |
author | Label on publish. |
onSaved / onExit | App callbacks. |
withNexus(nextConfig, options) (bundler)
Separate from nexus.config.ts. Loader options only:
| Option | Effect |
|---|---|
stripSuffixes | Same idea as naming.stripSuffixes for the transform. |
nameOverrides | Same idea as naming.overrides. |
exclude | Extra path substrings / regexes to skip in the bundler (always skips node_modules). |
Env vars (host app / SaaS — not Nexus CMS content config)
Examples for apps/web: MONGODB_URI, AUTH_SECRET, Filament
NEXUS_API_TOKEN / NEXT_PUBLIC_NEXUS_*. These are application secrets, not
nexus.config.ts fields.
Not available as config today
| Capability | Status |
|---|---|
| Theme / overlay colors / toolbar layout | Hardcoded in @nexus-cms/react styles |
| Custom editor panels / plugins | Not pluggable via config |
| Scheduled publish / A-B / audit log | License feature names exist; no features.* toggles yet |
| Roles / permissions / multi-user ACL | Not in config |
| Media CDN / upload limits | Adapter-specific, not config |
| Page list / routes | Discovered from source + schema, not a config array |
| SEO field schema customization | Fixed SEO panel fields |
breakpoints driving the overlay | Declared only; unused by runtime |
Auto-mounting backend.adapter | You wire the adapter in React |
Feature flags vs license
Flags are resolved against your license. versions, locales, and
collectionAddRemove are Pro features — turning a flag on later needs no
region rewrites, but the key/tier must allow it.