Skip to main content

Usage

Step 1 — Get your Firebase Web API key (one-time lookup)

It's inside the VITE_PUBLIC_FIREBASE_CONFIG env var. If you run via Doppler, it's auto-loaded. Otherwise, find it in the Firebase Console → Project Settings → General → Your apps → Web app → apiKey.

Step 2 — Run the script

With Doppler (reads VITE_PUBLIC_FIREBASE_CONFIG automatically)

doppler run -- pnpm --filter @flowpos-workspace/backend-scripts cli:token
--email testuser@local.dev
--password TestPass123!

Without Doppler (pass the key directly)

pnpm --filter @flowpos-workspace/backend-scripts cli:token
--email testuser@local.dev
--password TestPass123!
--api-key YOUR_FIREBASE_WEB_API_KEY Output:

Attempting sign-up for: testuser@local.dev New user created successfully.

✅ Firebase UID : abc123xyz Email : testuser@local.dev Expires in : 60 minutes

--- ID TOKEN (copy everything below this line) --- eyJhbGciOiJSUzI1NiIsImtpZCI6... --- END TOKEN --- Step 3 — Test onboarding endpoints

TOKEN="eyJhbGciOiJSUzI1NiIsImtpZCI6..."

Check status (first time = step: business)

curl -H "Authorization: Bearer $TOKEN"
http://localhost:4000/users/me/onboarding/status

Create business (first onboarding step)

curl -X POST
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: application/json"
-d '{"name":"Test Restaurant","businessType":"restaurant","countryId":"GT"}'
http://localhost:4000/users/me/onboarding/business

Check status again (should now be step: location, with billing field separate)

curl -H "Authorization: Bearer $TOKEN"
http://localhost:4000/users/me/onboarding/status Re-running the script with the same email/password signs in again and prints a fresh token. The token expires in 60 minutes — just rerun to refresh it.