Simple Node backend that proxies Firebase Authentication to issue custom tokens.
- Copy
.env.exampleto.envand fill in your Firebase project values:FIREBASE_PROJECT_IDFIREBASE_CLIENT_EMAILFIREBASE_PRIVATE_KEY(remember to keep escaped new lines\ninside quotes)FIREBASE_WEB_API_KEY- optional
PORT
- Run
npm startto boot the HTTP server (defaults to port 4000).
POST /api/auth/register– body{ email, password, displayName? }.- creates the Firebase user via the Identity Toolkit API.
- returns
{ uid, customToken }.
POST /api/auth/login– body{ email, password }.- verifies the Firebase credentials via the Identity Toolkit API.
- returns
{ uid, customToken }.
GET /health– basic readiness probe.
Responses include a Firebase custom token generated with your service account credentials.