You're reading docs for Nextly Alpha. APIs may change between releases.

Configuration

Configuration

Configure your Nextly application with collections, singles, field groups, fields, storage, security, and more.

Nextly is configured through a single nextly.config.ts file at the root of your project. That file is the source of truth for your content model, database output paths, storage backends, security settings, email, and admin panel branding.

The config file

Every Nextly project has a nextly.config.ts that exports a config built with defineConfig():

nextly.config.ts
import { defineConfig } from "nextly";
import Posts from "./src/collections/posts";
import Media from "./src/collections/media";
import SiteSettings from "./src/singles/site-settings";

export default defineConfig({
  collections: [Posts, Media],
  singles: [SiteSettings],
  db: {
    schemasDir: "./src/db/schemas/collections",
    migrationsDir: "./src/db/migrations",
  },
  typescript: {
    outputFile: "./src/types/generated/payload-types.ts",
  },
});

What you can configure

AreaDescription
Nextly configEvery option in defineConfig() with types and defaults
CollectionsContent types with multiple entries (blog posts, products, media)
SinglesOne-off documents (site settings, header, footer)
Field GroupsReusable field groups embedded in collections and singles
FieldsField types, options, validation, and helpers
Environment variablesEvery environment variable Nextly reads

Visual Schema Builder vs code-first

Collections, singles, and field groups can also be created visually in the Visual Schema Builder (the "Schema Builder" link inside the admin panel). The Schema Builder writes the same CollectionConfig, SingleConfig, and FieldGroupConfig shapes documented in this section, so anything you build visually maps 1:1 to a defineCollection, defineSingle, or defineFieldGroup call.

Next steps