nodejs-firestore icon indicating copy to clipboard operation
nodejs-firestore copied to clipboard

Connect to firestore in a different project

Open francesco-clementi opened this issue 7 years ago • 2 comments

I have actually a google app engine in "project-1", but the firestore is in "project-2". Is it possible to create a connection with firestore in a different project then the one of nodejs server?

francesco-clementi avatar Dec 05 '19 08:12 francesco-clementi

@francesco-clementi-bip you should be able to facilitate this by initializing firestore with a service account, from "project-2", rather than relying on default credentials loaded in app engine.

You do so by creating a service account with access to firestore, in the IAM UI, and then pointing to this JSON file with the environment variable GOOGLE_APPLICATION_CREDENTIALS.

see: https://cloud.google.com/docs/authentication/getting-started

Let me know if this does the trick for you :+1:

bcoe avatar Dec 05 '19 21:12 bcoe

Please let us know if you have any issues with the instructions linked to above.

schmidt-sebastian avatar Dec 06 '19 22:12 schmidt-sebastian