Authentication schemes
Firebase ID token
Dashboard operations — listing and managing API keys, inspecting usage, and fetching user info — require a Firebase ID token obtained after signing in through Firebase Authentication. Pass the token in theAuthorization header:
SC_AUTH_DEV=1), the server accepts synthetic tokens of the form dev:<uid>:<email> so you can test locally without a live Firebase project. See the API Dashboard guide for full Firebase setup instructions.
API key
The/v1/compress endpoint is protected by an API key. Keys are prefixed with sc_live_ and can be passed in either of two ways:
API keys are created via
POST /api/keys and are shown only once at creation time. SuperCompress stores only a SHA-256 hash — if you lose the key you must create a new one.Endpoint overview
Getting an API key
- Start the dashboard locally or point your browser at your deployed instance.
- Sign in with Firebase Authentication (or use dev mode — see below).
- Open the Keys panel and click Create key. Give it a name (default:
"Production"). - Copy the full
sc_live_…value immediately — it is shown only once.
Dev mode
SetSC_AUTH_DEV=1 to skip Firebase token verification. Pass a synthetic token instead:
Unauthenticated endpoints
POST /api/compress is intentionally unauthenticated. It powers the in-browser playground and is convenient for local smoke tests. It accepts the same body as /v1/compress, plus an optional compare: true field that runs all built-in policies side-by-side.
GET /api/health returns {"ok": true, "service": "supercompress-web"} and requires no credentials.
Base URL
The dashboard JavaScript reads
SC_API_BASE from firebase-config.js; set that variable if your dashboard is served from a different origin than the API server.