Skip to content

Conversation

@dherbst
Copy link

@dherbst dherbst commented Jan 29, 2026

Firebase App Hosting configures the backend server so that it can use Role based authentication instead of needing a file for GOOGLE_APPLICATION_CREDENTIALS. Therefore, it is not necessary for the nuxt-vuefire module to warn that the GAC environment variable is missing and not initialize the firebase application on the server side.

This PR adds a new configuration option to nuxt-vuefire to specify that the server is going to use role based authentication and the GOOGLE_APPLICATION_CREDENTIALS environment variable is not necessary.

This fixes issue #1636 when deploying to Firebase App Hosting so you do not need to add an additional unnecessary credential.

Summary by CodeRabbit

  • New Features

    • Added a useRole option to enable role-based authentication for Firebase App Hosting (defaults to false).
    • App Check behavior updated to work smoothly when role-based authentication is enabled.
  • Documentation

    • Docs updated with guidance and examples for configuring and using role-based authentication with VueFire.

✏️ Tip: You can customize this high-level summary in your review settings.

When using Firebase App Hosting, can use role based authentication instead of setting GOOGLE_APPLICATION_CREDENTIALS env variable for vuejs#1636
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Adds a new boolean useRole option to the Nuxt VueFire module configuration. The option is declared in public types, passed through module resolution and runtime config, influences hasServiceAccount computation and App Check disablement logic, and is included in a test fixture and docs.

Changes

Cohort / File(s) Summary
Configuration and Types
packages/nuxt/src/module/options.ts, docs/nuxt/getting-started.md
Added optional useRole?: boolean to VueFireNuxtModuleOptions with documentation explaining role-based authentication requirements for Firebase App Hosting.
Module Implementation
packages/nuxt/src/module.ts
Propagated useRole into resolved options and runtime config; adjusted hasServiceAccount to consider useRole; modified App Check disablement condition and log message to account for useRole.
Test Fixture
packages/nuxt/tests/fixtures/basic/nuxt.config.ts
Added useRole: false to the fixture's vuefire.auth configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A little role hops into view,
A toggle set to false or true,
It joins the configs, neat and small,
Helping auth when calls befall.
Hooray — a rabbit's tiny cue! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: adding a new useRole configuration option specifically for Firebase App Hosting support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/nuxt/src/module/options.ts`:
- Around line 48-53: Update the JSDoc above the useRole option to reference the
correct environment variable name: replace GOOGLE_ACCOUNT_CREDENTIALS with
GOOGLE_APPLICATION_CREDENTIALS in the comment for the useRole property so the
documentation matches the actual env var; locate the comment block immediately
preceding the useRole?: boolean declaration and edit its text accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant