Skip to main content

Symptom → Cause → Fix


Allowed Origins

The embed player is scoped to domains you explicitly allow. Without this, the player returns ORIGIN_NOT_ALLOWED.
  1. Go to edpire.com → Integrations → Security tab → Allowed Embed Origins
  2. Add every origin your app runs on:
    • http://localhost:3000 (Next.js dev)
    • http://localhost:5173 (Vite dev)
    • https://yourapp.com (production)
  3. Save — changes take effect immediately (no rebuild needed)
To quickly confirm it’s an origin error, add a temporary onError log:

Token endpoint not found in production

If the player worked in npm run dev but fails in production with a 404 on /api/edpire/token, the token endpoint was probably a Vite dev-server middleware — which only runs during vite dev, not after vite build. Fix: Move the token endpoint to a real server route:
  • Next.js: app/api/edpire/token/route.ts with createEdpireTokenHandler() (works in both dev and prod)
  • Vite + SPA: Add an Express server and proxy /api to it — scaffold with npx --package=@edpire/sdk create-edpire-app vite-express my-app

API key exposed in browser bundle

If your API key is prefixed with VITE_ or NEXT_PUBLIC_, it compiles into the browser JavaScript. Anyone can read it.

Still stuck?