Skip to content

Commit ea864a6

Browse files
committed
feat(app-check): automatically pick up env variable
1 parent 60f7839 commit ea864a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/nuxt/src/module.ts

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
9797
// plugins
9898

9999
if (options.appCheck) {
100+
if (process.env.FIREBASE_APPCHECK_DEBUG_TOKEN) {
101+
options.appCheck.debug = process.env.FIREBASE_APPCHECK_DEBUG_TOKEN
102+
}
100103
addPlugin(resolve(runtimeDir, 'app-check/plugin.client'))
101104
// TODO: With emulators a different plugin should be used, one that doesn't instantiate app check as it will error on the server anyway
102105
if (hasServiceAccount || emulatorsConfig) {

src/app-check/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function useAppCheckToken() {
2525
export interface VueFireAppCheckOptions extends AppCheckOptions {
2626
/**
2727
* Setups the debug token global. See https://firebase.google.com/docs/app-check/web/debug-provider. Note you should
28-
* set to false in production (or not set it at all). It can be set to a string to force a specific token.
28+
* set to false in production (or not set it at all). It can be set to a string to force a specific debug token.
2929
*/
3030
debug?: boolean | string
3131
}

0 commit comments

Comments
 (0)