Configuration
Configure your Nextly application with collections, singles, components, 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():
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
| Area | Description |
|---|---|
| Nextly config | Every option in defineConfig() with types and defaults |
| Collections | Content types with multiple entries (blog posts, products, media) |
| Singles | One-off documents (site settings, header, footer) |
| Components | Reusable field groups embedded in collections and singles |
| Fields | Field types, options, validation, and helpers |
| Environment variables | Every environment variable Nextly reads |
Visual Schema Builder vs code-first
Collections, singles, and components 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 ComponentConfig shapes documented in this section, so anything you build visually maps 1:1 to a defineCollection, defineSingle, or defineComponent call.
Next steps
- Nextly config reference — every top-level option in
defineConfig() - Collections — content types with multiple entries
- Singles — single-document content like site settings
- Components — reusable field groups for collections and singles
- Fields — every available field type
- Environment variables — what to set in
.env