Search by

pantheon-systems-ps / pantheon_nextjs_demo

willjackson

Configures a Drupal site as the headless backend for a single Next.js front end on Pantheon: content model, JSON:API, OAuth, and the Next.js module wired up.

Package info

github.com/pantheon-systems-ps/pantheon_nextjs_demo

Type:drupal-recipe

pkg:composer/pantheon-systems-ps/pantheon_nextjs_demo

Statistics

Installs: 61

Dependents: 1

Suggesters: 0

Stars: 0

1.1.0 2026-09-23 21:37 UTC

This package is not auto-updated.

Last update: 2026-11-04 22:20:34 UTC


README

A Drupal recipe that configures a Drupal 10.4+ site as the headless backend for a single Next.js front end on Pantheon. It wires up the content model, JSON:API, OAuth, and the Next.js module so the front end can read content and revalidate pages out of the box.

Single-site variant. This recipe backs one Next.js front end. For a shared backend serving multiple independent front ends — with per-site content scoping via a field_next_site reference and layered vertical recipes — use pantheon-systems-ps/pantheon_nextjs_multi_demo instead.

Requirements

  • Drupal core 10.4 or newer.
  • drupal/next plus decoupled_router, consumers, simple_oauth, and pathauto — all pulled in automatically when you require this package.

What it adds

  • Page, Article, and Event content types, with their fields and form/view displays.
  • next.next_site.nextjs: registers the Next.js front end with base, preview, and revalidate URLs. The base URL is a recipe input (base_url), overridable per environment.
  • nextjs navigation menu, with the Page content type wired to use it.
  • JSON:API and the linkset_endpoint feature flag enabled for decoupled routing.
  • Preview and revalidation for Page, Article, and Event: each content type previews on the nextjs site and revalidates it with Drupal cache tags when content changes.
  • nextjs_preview role and OAuth scope, so the front end can read unpublished content for draft preview. The client secret and signing keys carry secrets, so they are set up at install time rather than shipped here.

Apply

composer require pantheon-systems-ps/pantheon_nextjs_demo
drush recipe recipes/pantheon_nextjs_demo
drush cache:rebuild

Set the front-end base URL for your environment:

drush recipe recipes/pantheon_nextjs_demo \
  --input=pantheon_nextjs_demo.base_url=https://your-frontend.example

Pair it with pantheon-systems-ps/pantheon_nextjs_demo_content to fill the site with ready-made sample content.