All articles

Why I Use Payload CMS for Everything Now

Payload gave me a CMS that generates my TypeScript types, runs in the same Next.js process, and lets me write real access control without fighting the platform.

Every headless CMS I used before Payload had the same problem: it lived outside my application. Content types were defined in a UI I could not version-control. Types were generated by a third-party tool that lagged behind schema changes.

Payload flips all of that. The schema is TypeScript. The application and the CMS run in the same Next.js process. Access control is a function that receives the request and returns a boolean or a database where clause.

The schema-as-code advantage

A Payload collection is a TypeScript file. It lives in the repository, goes through code review, and has a history in git. When I rename a field, I rename a string in my editor and run the type generator.

The generated types flow into every component, API route, and hook that touches that data. A schema change that breaks a consumer is a TypeScript error, not a runtime surprise.

Access control that actually scales

Most CMS platforms give you role-based access with a fixed set of roles and permissions. That covers 70% of cases.

The other 30% is where Payload is useful. An access control function that returns a query means you can write row-level security in the same language as the rest of the application:

read: ({ req }) => req.user ? { author: { equals: req.user.id } } : false

Hooks as the integration layer

Payload hooks run before and after every operation. afterChange for sending notifications or revalidating Next.js cache. beforeOperation for enforcing business rules that do not belong in the schema.

I have replaced several purpose-built microservices with Payload hooks. The logic is colocated with the data it acts on, which is where it belongs.

The tradeoffs worth knowing

  • The admin UI is functional but not as polished as Contentful or Sanity. For non-technical editors, that gap matters.
  • Local API performance depends on the database connection. Unlike a hosted CMS, you own the infrastructure.
  • The documentation has gaps for advanced use cases. The source code and Discord fill most of them.

For projects where I control the stack and the content editors are technical, Payload is the best tool I have used.