Skip to content

payload

Use when working with Payload CMS — collection configuration, field types, access control, or Next.js integration. Also use when choosing a code-first CMS or self-hosting a headless CMS.

ModelSource
sonnetpack: cms
Full Reference

┏━ 🔧 payload ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with Payload CMS — collection… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Payload 3.x is a code-first, Next.js-native headless CMS — it runs inside your Next.js app with no separate server process. Collections, access control, hooks, and the admin panel are all defined in TypeScript. Requires Node.js 20.9.0+ and Next.js 15.2.9+.

ItemValue
Installnpx create-payload-app@latest
Admin URLhttp://localhost:3000/admin
REST API/api/<collection-slug>
GraphQL/api/graphql
Key env varsPAYLOAD_SECRET, DATABASE_URL, NEXT_PUBLIC_SERVER_URL
TypeGennpx payload generate:types
Migrationsnpx payload migrate
Version3.x (3.44+)
I want to…File
Set up a new project, configure adapters, and deployreference/setup.md
Define collections, globals, and all field typesreference/collections.md
Query data via Local API, REST, and GraphQLreference/queries.md
Configure collection and field-level access controlreference/access-control.md
Write beforeChange, afterChange, and other lifecycle hooksreference/hooks.md
Customize the admin panel, handle uploads, and configure storagereference/api.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.