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

GOOGLE_APPLICATION_CREDENTIAL alternative for monorepos #1462

Closed
mklueh opened this issue Nov 12, 2023 · 8 comments
Closed

GOOGLE_APPLICATION_CREDENTIAL alternative for monorepos #1462

mklueh opened this issue Nov 12, 2023 · 8 comments

Comments

@mklueh
Copy link

mklueh commented Nov 12, 2023

What problem is this solving

Hi there,

as it seems that declaring the service account the old way in nuxt.config.ts is gone

    admin: {
      serviceAccount: "serviceAccountKey.json"
    }

There needs to be a way to handle multiple such serviceAccountKeys for multiple applications within a monorepo.

I'm not sure if there is any alternative at all right now and if this might already possible, but I have at least not seen a way to specify the json file anymore.

Maybe it's this property now?

image

But it says "ID", which does not sound like the file to me.

Proposed solution

Describe alternatives you've considered

No response

@posva
Copy link
Member

posva commented Nov 12, 2023

@mklueh Can you detail how do you handle things when you deploy to Firebase? Even if it's a mono repo, you should still be able to set different environment variables for each app

@juane1000
Copy link

juane1000 commented Nov 20, 2023

On a related note, can we also get a way to specify where "firebase.json" file is located so that the emulators get picked up?
I also have a monorepo setup and can't get the Nuxt plugin to connect to them even with the flag set.

@posva
Copy link
Member

posva commented Nov 20, 2023

Do you have an example that requires renaming the firebase.json file? Does that work with Firebase tools?

@Subin-Qreative
Copy link

in the documentation https://vuefire.vuejs.org/nuxt/environment-variables.html
it says you can set it to the content of the file itself. can you please show me an example of this. I am trying to self host on my own server , it works in development mode but soon as I do a build it doesn't work. I belive the service-account is not being found.

@Subin-Qreative
Copy link

Subin-Qreative commented Nov 22, 2023

it seems if im hosting my server on google cloud and has same account associated with that server in firebase , but if my config is targeting another firebase account it gets overridden and uses the account on google cloud where the server is hosted instead.... so weird

EDIT , this was indeed the case . fixed by initializing using credential: cert({ ## })

posva added a commit that referenced this issue Nov 22, 2023
@juane1000
Copy link

juane1000 commented Nov 23, 2023

Do you have an example that requires renaming the firebase.json file? Does that work with Firebase tools?

I use the default Firebase project structure where so that the directory looks something like this at the root:

  • firebase.json
  • functions/
  • apps/my-nuxt-app/

The 'apps' directory has multiple SSR applications in some web framework or another served via firebase cloud functions using shared database resources. Due to this nesting I believe vuefire can't find the firebase.json config. The 'firebase.json' config lets you specify the directory that contains your build output so it's no problem deploying with this setup. The instructions for this were from Nuxt/Nitro documentation at: https://nitro.unjs.io/deploy/providers/firebase

That all works for me and I can successfully deploy/serve my app. It's only vuefire that doesn't work so I had to use raw fb SDK.

Copy link
Member

posva commented Nov 23, 2023

I see, makes sense. Let’s add ann option. Feel free to submit a PR to accelerate things!

@posva
Copy link
Member

posva commented Dec 1, 2023

Instead of adding an option to define the path of the firebase.json file, let's remove the need to read it altogether: #1429

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants