Prompt

How do I set up a headless CMS for a React app and a marketing site?

Technology / Developer Tools1 observationLast seen Oct 20, 2026

Latest observation

Oct 20, 2026OpenAI APIWeb search: off

A good setup is:

  • Headless CMS for content editing
  • React app for the product/app UI
  • Marketing site for public pages, SEO, landing pages, blog, docs, etc.

1) Pick a headless CMS

Common choices:

  • Sanity — very flexible, great editor experience
  • Contentful — polished, enterprise-friendly
  • Strapi — self-hosted, full control
  • Directus — good if you already have a SQL database
  • Prismic / Storyblok — strong for marketing sites and page builders

If you want fast setup for both app content and marketing pages, Sanity or Contentful are usually easiest.


2) Decide what content each surface needs

Split content by use case:

React app content

Use CMS for things like:

  • onboarding copy
  • feature flags / announcements
  • FAQs
  • help articles
  • CMS-driven settings
  • user-facing messaging

Marketing site content

Use CMS for:

  • homepage sections
  • landing pages
  • blog posts
  • case studies
  • testimonials
  • pricing page content
  • SEO metadata

A useful pattern is to model content as reusable blocks:

  • hero
  • CTA
  • feature grid
  • FAQ
  • testimonials
  • rich text sections

3) Model your content types

Example content models:

For the marketing site

  • page
    • title
    • slug
    • sections[]
    • SEO fields
  • post
    • title
    • slug
    • body
    • author
    • publish date
  • testimonial
  • siteSettings

For the app

  • announcement
  • faq
  • copyBlock
  • helpArticle

Keep shared content in shared types when possible.


4) Set up the CMS

Example with Sanity

  1. Create a Sanity project
  2. Define schemas for your content types
  3. Set roles/permissions for editors
  4. Add preview URLs for local/staging
  5. Deploy the Studio

Example with Strapi

  1. Create Strapi project
  2. Create collection types and single types
  3. Set up API tokens and permissions
  4. Configure media uploads
  5. Deploy to a server or platform like Render/Fly/Heroku-style hosting

5) Connect the CMS to your React app

In React:

  • fetch content from the CMS API
  • render CMS blocks/components
  • use caching to reduce requests

Typical pattern:

  • create a cmsClient
  • create page components that map CMS sections to React components
  • use environment variables for API keys and endpoints

Example flow:

  1. CMS returns a page with sections
  2. React maps each section to a component
  3. Components render based on section type

6) Build the marketing site with SEO in mind

The marketing site should usually use:

  • Next.js or another SSR/SSG framework
  • static generation for fast loading and SEO
  • CMS content fetched at build time or on revalidation

Best practice:

  • use static generation for most pages
  • use incremental revalidation or webhook-triggered rebuilds when content changes
  • store meta title, description, Open Graph image, canonical URL in CMS

If your marketing site is separate from the app, Next.js is a common choice.


7) Use webhooks for publishing

When content changes in the CMS:

  • trigger a rebuild of the marketing site
  • or trigger revalidation of specific pages

This keeps content fresh without manual deploys.


8) Set up previews

Editors usually want to preview changes before publishing.

Do this by:

  • having a preview environment
  • reading draft content in preview mode
  • using a secret token for draft access
  • showing “Preview” links from the CMS to your site

9) Handle authentication and security

  • Keep private tokens on the server only
  • Use public read-only endpoints where needed
  • Restrict write access to CMS users
  • Separate staging and production environments
  • Validate content before rendering

10) Recommended architecture

A common, clean setup:

  • CMS: Sanity / Contentful / Strapi
  • Marketing site: Next.js
  • React app: React or Next.js
  • Shared design system: component library used by both
  • API layer: fetch CMS content server-side where possible

If both the app and marketing site are in the same codebase, you can share:

  • CMS client
  • content types
  • UI components
  • validation logic

11) Suggested implementation path

If you want to move quickly:

  1. Choose CMS
  2. Define content models
  3. Build marketing pages first
  4. Add preview and publishing flow
  5. Connect React app for app-specific content
  6. Add caching/revalidation
  7. Deploy and test editor workflow

12) A practical stack recommendation

If you want an opinionated stack:

  • CMS: Sanity
  • Marketing site: Next.js
  • Product app: React or Next.js
  • Hosting: Vercel
  • Images: Sanity image pipeline or Cloudinary
  • Auth: app-specific, separate from CMS

This gives you:

  • strong editor UX
  • good preview support
  • good SEO
  • fast iteration

If you want, I can also give you:

  1. a step-by-step setup with Sanity + Next.js, or
  2. a content model example for a marketing site and React app.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.