Digital Engines logoDigital Engines
←Back to Journal
CMS·November 3, 2026·13 min read

The headless CMS guide: Payload, Sanity, Strapi, Contentful and Directus

DE
Digital Engines
Design & Technology Studio
Editorial layouts representing structured content management
ESSAY · 13 min read

A traditional CMS ties your content to one website theme. A headless CMS stores content as structured data and delivers it through an API, so your Next.js site, mobile app and anything else can all use the same content. Here are the five headless CMSs we recommend most, and how we connect each one.

1. What to look for in a headless CMS

The right CMS depends on who edits content, how much control developers need and where you want the data to live.

  • Editor experience: live preview, drafts, scheduling and an interface non-technical people enjoy.
  • Developer experience: typed content models, a good API and easy local development.
  • Hosting: self-hosted (you control data and cost) or fully managed (less maintenance).
  • Pricing model: per seat, per usage, or free open source plus hosting costs.
  • Localisation, roles and permissions if you publish in several languages or have large teams.
“A CMS is only successful if editors can publish confidently without opening a ticket for the developers.”
— Strategic Takeaway

2. Payload: open-source CMS that lives inside your Next.js app

Payload is a TypeScript-first, open-source CMS. Since version 3 it installs directly inside a Next.js project, so your website and admin panel share one codebase and one deployment. Content models are written in code, which makes them version-controlled and fully typed.

Pricing (checked November 2026): Payload is MIT-licensed and free. You only pay for hosting (for example Vercel or Render), a database (Postgres or MongoDB) and file storage.

Best for: developer-led teams, custom web apps, and projects where you want full ownership of code and data with no licence fees.

Create a new Payload + Next.js projectbash
npx create-payload-app@latest
payload.config.ts (simplified)ts
import { buildConfig } from "payload";
import { postgresAdapter } from "@payloadcms/db-postgres";
import { lexicalEditor } from "@payloadcms/richtext-lexical";

export default buildConfig({
  secret: process.env.PAYLOAD_SECRET!,
  editor: lexicalEditor(),
  db: postgresAdapter({ pool: { connectionString: process.env.DATABASE_URL } }),
  collections: [
    {
      slug: "posts",
      admin: { useAsTitle: "title" },
      fields: [
        { name: "title", type: "text", required: true },
        { name: "slug", type: "text", unique: true },
        { name: "content", type: "richText" },
      ],
    },
  ],
});
Fetch posts in a Server Component (no HTTP call needed)tsx
import { getPayload } from "payload";
import config from "@payload-config";

export default async function BlogPage() {
  const payload = await getPayload({ config });
  const { docs } = await payload.find({ collection: "posts", limit: 10 });

  return <ul>{docs.map((post) => <li key={post.id}>{post.title}</li>)}</ul>;
}
The headless CMS guide: Payload, Sanity, Strapi, Contentful and Directus visual illustration
FIG. 01 — CMS Study

3. Sanity: real-time collaboration and flexible content

Sanity combines a hosted content database (the Content Lake) with Sanity Studio, a fully customisable editing interface built in React. Multiple editors can work on the same document in real time, and content is queried with GROQ, a powerful query language.

Pricing (checked November 2026): the Free plan includes up to 20 seats and 10,000 documents. Growth costs $15 per seat per month and raises limits to 25,000 documents. Enterprise is custom. Viewers do not use a paid seat.

Best for: marketing teams, editorial websites and brands that need live collaboration and a highly tailored editing experience.

Create a Studio and install the Next.js toolkitbash
npm create sanity@latest
npm install next-sanity
lib/sanity.tsts
import { createClient } from "next-sanity";

export const sanity = createClient({
  projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!,
  dataset: "production",
  apiVersion: "2026-11-01", // lock to a date for stable API behaviour
  useCdn: true,             // fast, cached reads for published content
});

export async function getPosts() {
  return sanity.fetch(
    '*[_type == "post"] | order(publishedAt desc)[0...10]{ title, "slug": slug.current, publishedAt }'
  );
}

4. Strapi: the popular open-source API builder

Strapi is one of the most widely used open-source headless CMSs. You design content types in a visual builder and Strapi generates REST and GraphQL APIs automatically. It has a large plugin ecosystem and runs on Postgres, MySQL or SQLite.

Pricing (checked November 2026): the Community edition is free to self-host. Strapi Cloud adds managed hosting with Free, Essential, Pro (around $90/month) and Scale (around $450/month) plans. Advanced CMS features such as review workflows are a separate licence, starting at about $45/month for three seats.

Best for: teams that want a familiar admin panel, auto-generated APIs and the option to self-host.

Create a Strapi projectbash
npx create-strapi@latest my-cms
lib/strapi.tsts
const STRAPI_URL = process.env.STRAPI_URL!;

export async function getArticles() {
  const res = await fetch(`${STRAPI_URL}/api/articles?populate=*&sort=publishedAt:desc`, {
    headers: { Authorization: `Bearer ${process.env.STRAPI_API_TOKEN}` },
    next: { revalidate: 60 }, // re-fetch at most once a minute
  });

  if (!res.ok) throw new Error("Failed to load articles from Strapi");
  const json = await res.json();
  return json.data;
}

5. Contentful: enterprise-grade content platform

Contentful is a mature, fully managed content platform used by large brands. It offers strong governance, localisation, environments and a big app marketplace, all delivered through a fast global CDN.

Pricing (checked November 2026): a Free plan exists for small projects and learning. The Lite plan starts at about $300/month, and Enterprise is custom. There is a large jump between free and paid, so it suits organisations with a real content budget.

Best for: larger companies, multi-brand and multi-language websites, and teams that need enterprise permissions and SLAs.

Installbash
npm install contentful
lib/contentful.tsts
import { createClient } from "contentful";

const client = createClient({
  space: process.env.CONTENTFUL_SPACE_ID!,
  accessToken: process.env.CONTENTFUL_DELIVERY_TOKEN!,
});

export async function getBlogPosts() {
  const entries = await client.getEntries({
    content_type: "blogPost",
    order: ["-sys.createdAt"],
    limit: 10,
  });
  return entries.items;
}

6. Directus: instant admin panel on top of your own SQL database

Directus connects to an existing SQL database and instantly gives you an admin app and REST/GraphQL APIs, without changing your tables. That makes it excellent for internal tools and for projects where the database already exists.

Pricing (checked November 2026): self-hosting is free for organisations under $5M annual revenue and fewer than 50 employees, and Directus Cloud hosting costs $99/month for them. Larger organisations need a commercial licence.

Best for: data-heavy projects, internal dashboards and teams that want a CMS layer over a database they already own.

Run locally with Dockerbash
docker run -p 8055:8055 \
  -e SECRET="replace-with-a-long-random-string" \
  -e ADMIN_EMAIL="admin@example.com" \
  -e ADMIN_PASSWORD="change-me" \
  directus/directus
Install the SDKbash
npm install @directus/sdk
lib/directus.tsts
import { createDirectus, rest, readItems } from "@directus/sdk";

const directus = createDirectus(process.env.DIRECTUS_URL!).with(rest());

export async function getPublishedArticles() {
  return directus.request(
    readItems("articles", {
      filter: { status: { _eq: "published" } },
      sort: ["-date_created"],
      limit: 10,
    })
  );
}

7. Our integration checklist

No matter which CMS a client chooses, these steps keep the website fast, secure and easy to edit.

  • Fetch content on the server (Server Components or API routes) so API tokens never reach the browser.
  • Cache responses and revalidate on publish with a CMS webhook, so pages update instantly but load fast.
  • Set up live preview so editors see drafts exactly as they will appear on the site.
  • Generate TypeScript types from content models to catch broken fields at build time.
  • Store images through the CMS or a CDN and serve them with next/image for automatic optimisation.
  • Train the client's team and document the content models before handover.
app/api/revalidate/route.ts: refresh pages when content is publishedts
import { revalidateTag } from "next/cache";

export async function POST(request: Request) {
  const secret = request.headers.get("x-webhook-secret");
  if (secret !== process.env.CMS_WEBHOOK_SECRET) {
    return new Response("Unauthorized", { status: 401 });
  }

  revalidateTag("posts"); // pages fetched with { next: { tags: ["posts"] } } refresh
  return Response.json({ revalidated: true });
}

Headless CMS comparison

CMSHostingOpen sourcePricing (from)Best for
PayloadSelf-hosted (inside Next.js)Yes (MIT)Free + hosting costsDeveloper-led custom builds
SanityManagedStudio onlyFree; Growth $15/seat/moCollaborative marketing content
StrapiSelf-hosted or Strapi CloudYesFree self-hosted; Cloud plansAuto-generated APIs, plugins
ContentfulManagedNoFree; Lite ~$300/moEnterprise and multi-brand
DirectusSelf-hosted or CloudSource-availableFree for small orgs; Cloud $99/moCMS over an existing SQL database

Prices checked November 2026 and simplified. Licence terms and plan limits change, so confirm on each vendor's pricing page.

Core Takeaways

Principles for deliberate execution

  • 1Headless CMSs separate content from design, so one source can feed a website, an app and more.
  • 2Payload and Strapi are open source and free to self-host; Sanity and Contentful are hosted platforms.
  • 3Seat-based and usage-based pricing can grow fast, so model your editor count and traffic before choosing.
  • 4Always fetch CMS content on the server and cache it, so the site stays fast and API costs stay low.
Tagged:#Headless CMS#Payload#Sanity#Strapi#Contentful#Directus
DE
Written by
Digital Engines

Digital Engines engineers SaaS platforms, high-performance websites, mobile apps and AI systems for ambitious teams worldwide. These guides come from the tools we use on real client projects every day.

Get in touch →
Continue reading

More from the journal

All essays →