Changes
- fix(cors): apply CORS middleware globally so
/auth/*routes work from Astro/Next.js/frontend frameworks - fix(forms): forms plugin no longer returns 500 when
formstable hasn't been migrated — shows empty state instead - docs: added CORS configuration section to authentication.md and getting-started.md troubleshooting guide
CORS fix for Astro / frontend frameworks
If you're calling SonicJS from a separate frontend (Astro, Next.js, etc.), add your dev origin to wrangler.toml:
[vars]
CORS_ORIGINS = "http://localhost:8787,http://localhost:4321"Then use credentials: 'include' in your fetch calls:
const res = await fetch('https://your-cms.workers.dev/auth/login', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password }),
})Installation
npm create sonicjs@beta my-appOr update existing project:
npm install @sonicjs-cms/core@3.0.0-beta.12