Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Nuxt note about public environment variables #1562

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/nuxt/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Nuxt VueFire automatically picks up a few environment variables to configure Firebase from your `.env` file. These usually take precedence over other options defined in `nuxt.config.ts`. They usually try to support the existing Firebase environment variables better.

The VueFire config is treated as public Nuxt config, which means that any env variable [defined using the Nuxt convention](https://nuxt.com/docs/guide/going-further/runtime-config#environment-variables) will automatically be picked up by Nuxt. This means you can add, for example, `NUXT_PUBLIC_VUEFIRE_CONFIG_API_KEY=xyz` to your `.env` file and the value will populate in your app at runtime. You will still need to provide empty string values to the vuefire config to prevent an error during development.
posva marked this conversation as resolved.
Show resolved Hide resolved

## Admin SDK

During development, if you are doing SSR, you must provide the `GOOGLE_APPLICATION_CREDENTIALS` environment variable with the path to the service account file. This is usually a JSON file you can download from the Firebase Console > Project Settings > Service Accounts > Generate new private key.
Expand Down