Configuration
Configuration
Configure your Nextly application with collections, singles, storage, security, and more.
Nextly is configured through a nextly.config.ts file at the root of your project. This file is the single source of truth for your content model, database output paths, storage backends, security settings, and admin panel branding.
The Config File
Every Nextly project has a nextly.config.ts that exports a config object created with defineConfig():
import { defineConfig } from '@nextlyhq/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 |
|---|---|
| Collections | Content types with multiple entries (blog posts, products, users) |
| Singles | One-off documents (site settings, header, footer) |
| Components | Reusable field groups embedded in collections and singles |
| Fields | Field types, validation, and helpers |
| Database | Schema and migration output directories |
| TypeScript | Generated type output path and module augmentation |
| Storage | Cloud storage backends (S3, Vercel Blob) for file uploads |
| Security | CORS, rate limiting, headers, input sanitization |
| Admin | Branding, logo, colors, favicon, plugin sidebar placement |
| Plugins | Extend Nextly with custom functionality |
| Email provider and template configuration | |
| Users | Custom fields on the built-in user model |
Next Steps
- Nextly Config Reference -- Every option in
defineConfig()with types and defaults - Collections -- Define content types with fields, hooks, and access control
- Singles -- Define single-document content like site settings
- Fields -- All available field types and how to use them
- Environment Variables -- All environment variables for database, auth, and storage