Skip to content

Commit fd5db49

Browse files
committed
feat(app-check): allow debug in production with VUEFIRE_APPCHECK_DEBUG
1 parent d10c77c commit fd5db49

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/nuxt/environment-variables.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,14 @@ FIREBASE_APPCHECK_DEBUG_TOKEN=********-****-****-****-************
2727
These can be generated on the Firebase Console > AppCheck > Apps > Manage Debug Tokens.
2828

2929
This variable will not be used in production unless `debug: true` is passed during a build or generate command. This allows you to still test locally using a debug token without having to worry about accidentally deploying it to production.
30+
31+
## Debugging utilities
32+
33+
You can activate these while developing or building locally by setting them before running the command:
34+
35+
```bash
36+
VUEFIRE_APPCHECK_DEBUG=true VUEFIRE_EMULATORS=true pnpm run build
37+
```
38+
39+
- `VUEFIRE_APPCHECK_DEBUG=true` will activate the AppCheck debug even in production.
40+
- `VUEFIRE_EMULATORS=true` will activate the Firebase Emulators even in production.

packages/nuxt/src/module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
113113
process.env.FIREBASE_APPCHECK_DEBUG_TOKEN &&
114114
// only use the debug token if the user explicitly set debug to true or if nothing was provided and we are not in production
115115
(options.appCheck.debug === true ||
116+
// allow a manual override from the console before bundling
117+
process.env.VUEFIRE_APPCHECK_DEBUG ||
116118
(options.appCheck.debug == null &&
117119
process.env.NODE_ENV !== 'production'))
118120
) {

0 commit comments

Comments
 (0)