Keys / Firebase

FIREBASE_SERVICE_ACCOUNT

A service account's JSON key, which the Firebase Hosting GitHub Action deploys your site with.

Expires
never, unless your organization sets a limit
API
create, disable and delete keys, with the IAM API

Get it

Create one on console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk. The steps aren't recorded yet.

Set it

FIREBASE_SERVICE_ACCOUNT=...

The Firebase Admin SDKs don't read it; they read a key file's path from GOOGLE_APPLICATION_CREDENTIALS. The Hosting action takes it as firebaseServiceAccount. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. In the Cloud console's Service accounts page, open the service account the old key belongs to and add a new JSON key. A service account can have up to 10 keys.
  2. Put the new JSON in every secret named FIREBASE_SERVICE_ACCOUNT.
  3. Check that nothing still uses the old key, then disable it in the Cloud console. Once deploys work, delete it; a deleted key can't be restored.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16