CodeScreen

CodeScreen Journal

Engineering Blog

codescreen.in

CodeScreen Journal

© 2026 CodeScreen Technology

codescreen.inPrivacyTerms
CodeScreen

CodeScreen Journal

Engineering Blog

codescreen.in
Back to blog

On this page

Recent articles

—

Engineering10 Nov 20260 reads

Headless CMS Integration Guide

Plan B: PHP bridge + Next.js static export for codescreen.in — end-to-end wiring explained.

Headless CMS Integration Guide

Why a bridge instead of direct browser calls

The marketing site is a static export. API tokens must never ship to the browser. A server-side proxy adds the X-Website-Token header and enforces read-only GET routes.

Request flow

  1. Browser fetches /cms-api.php?path=blog/posts on codescreen.in

  2. PHP reads cms-api.config.php and forwards to cms.codescreen.in/api/v1

  3. Laravel validates token, website scope, and published status

  4. JSON flows back unchanged to the React blog pages

Local development

  • cs-cms on (or https://cms.codescreen.in in production)

  • Local Next.js dev calls the API directly with cms-api.config.php

  • Production codescreen.in uses cms-api.php so the token never ships in JavaScript

Whitelisted domains apply when the browser calls the CMS API directly. The production PHP bridge calls the CMS server-side and does not rely on Origin allowlists.

Security checklist: rotate tokens in Filament, keep cms-api.config.php out of git, and deploy BlogPostController scoping before production traffic.

PreviousGitHub for Developers: What It Actually DoesNext What Every New Developer Should Learn First

Related articles

  • Digital Identity for Enterprise
    Digital Identity for Enterprise1 Nov 2026
  • Welcome to the CodeScreen Blog
    Welcome to the CodeScreen Blog30 Oct 2026

CodeScreen Journal

© 2026 CodeScreen Technology

codescreen.inPrivacyTerms