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

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():

nextly.config.ts
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

AreaDescription
CollectionsContent types with multiple entries (blog posts, products, users)
SinglesOne-off documents (site settings, header, footer)
ComponentsReusable field groups embedded in collections and singles
FieldsField types, validation, and helpers
DatabaseSchema and migration output directories
TypeScriptGenerated type output path and module augmentation
StorageCloud storage backends (S3, Vercel Blob) for file uploads
SecurityCORS, rate limiting, headers, input sanitization
AdminBranding, logo, colors, favicon, plugin sidebar placement
PluginsExtend Nextly with custom functionality
EmailEmail provider and template configuration
UsersCustom 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

On this page

Was this page helpful?