Skip to content

Commit

Permalink
Update docs/nuxt/environment-variables.md
Browse files Browse the repository at this point in the history
  • Loading branch information
posva authored Aug 6, 2024
1 parent d551595 commit 20a8982
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/nuxt/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +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.
Since VueFire config is treated as _Public Runtime Config_, it can also be overridden with [env variables by following the Nuxt convention](https://nuxt.com/docs/guide/going-further/runtime-config#environment-variables). For example, an environment variable named `NUXT_PUBLIC_VUEFIRE_CONFIG_API_KEY=xyz` will override the `config.apiKey`.
Note you still need to provide empty string values to each `config` property that is defined this way.

## Admin SDK

Expand Down

0 comments on commit 20a8982

Please sign in to comment.