A demo app showing how to securely embed Holistics analytics portals into a React application using JWT-based authentication.
Live URL: https://holistics-embed-demo.pages.dev
- Frontend: React, Vite, Tailwind CSS
- Backend: Node.js, Express,
jsonwebtoken - Deployment: Cloudflare Pages + Pages Functions
├── backend/
│ └── server.js # Express API server (local dev)
├── frontend/
│ ├── functions/api/ # Cloudflare Pages Functions (production)
│ ├── src/ # React app source
│ ├── public/ # Static assets
│ ├── index.html
│ ├── vite.config.js
│ ├── tailwind.config.js
│ ├── postcss.config.js
│ └── eslint.config.js
├── functions/ # Cloudflare Pages Functions (deploy copy)
└── package.json
npm installCreate a .env file in the project root:
HOLISTICS_EMBED_KEY=your_embed_key_here
HOLISTICS_EMBED_SECRET=your_embed_secret_herenpm run server
# → http://localhost:3001npm run dev
# → https://localhost:5173Open https://localhost:5173 in your browser. Accept the self-signed certificate warning.
The app is deployed to Cloudflare Pages with serverless functions handling the API.
Live URL: https://holistics-embed-demo.pages.dev
# Build the frontend
npm run build
# Copy functions to root (Cloudflare expects functions/ as sibling to output dir)
cp -r frontend/functions functions
# Deploy
CLOUDFLARE_ACCOUNT_ID=<your_account_id> wrangler pages deploy dist \
--project-name holistics-embed-demo \
--branch main \
--commit-dirty=trueecho -n 'your_key' | CLOUDFLARE_ACCOUNT_ID=<your_account_id> \
wrangler pages secret put HOLISTICS_EMBED_KEY --project-name holistics-embed-demo
echo -n 'your_secret' | CLOUDFLARE_ACCOUNT_ID=<your_account_id> \
wrangler pages secret put HOLISTICS_EMBED_SECRET --project-name holistics-embed-demo