firebasenext.jsgoogle-secret-managerfirebase-app-hosting

How to set up different environment variable using Firebase App Hosting


I'm new to Firebase and I'm planning to create 2 Firebase projects, 1 for test environment and 1 for production environment. I want to deploy a NextJS web app and while I understand that I can use the same codebase and link it to 2 projects, I can only see that in this doc, it's reliant on apphosting.yaml for environment variables and secrets, but it will be checked in git. So that means we only have 1 set of values regardless of which Firebase project we're in.

How do I create different sets of env variables and secrets for each project? Or am I approaching this the wrong way?

I'm still in planning stage, only reading through the documents, so I don't know how to start.


Solution

  • Hi there, Firebaser here

    We now have official support for multiple environments! You can find more information here https://firebase.google.com/docs/app-hosting/multiple-environments

    This should address your use case, take a look and let us know what you think!