Mindful Auth - Deploy Astro Template to Cloudflare Workers
This template is pre-configured for Cloudflare Workers deployment using the official Astro Cloudflare adapter.
Ensure your astro.config.mjs and wrangler.jsonc are set up as follows:
import cloudflare from '@astrojs/cloudflare';
export default defineConfig({ output: 'server', adapter: cloudflare({ mode: 'directory', }),});{ "main": "dist/_worker.js/index.js", "name": "your-site-name", "compatibility_date": "2026-01-21", "compatibility_flags": [ "nodejs_compat", "global_fetch_strictly_public" ], "routes": [ { "pattern": "example.com/*", "zone_name": "example.com" } ], "assets": { "binding": "ASSETS", "directory": "./dist" }, "observability": { "enabled": true }}Build and deploy:
npm run buildnpx wrangler deployEnvironment Variables
Section titled “Environment Variables”Mindful Auth requires the following environment variables to function correctly:
| Variable | Required | Description |
|---|---|---|
INTERNAL_API_KEY | Yes | Your tenant’s internal API key from Mindful Auth |
Cloudflare Workers: Use npx wrangler secret put INTERNAL_API_KEY or add via dashboard