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

keyFilename and env variables #397

Closed
JFGHT opened this issue Oct 17, 2018 · 3 comments · Fixed by #399
Closed

keyFilename and env variables #397

JFGHT opened this issue Oct 17, 2018 · 3 comments · Fixed by #399
Assignees
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@JFGHT
Copy link

JFGHT commented Oct 17, 2018

Basically I'm having a similar problem to this one: googleapis/google-cloud-node#136

and I didn't find in the docs any other approach than the keyFilename which it only accepts a string to the path of the file.

@leeuwd
Copy link

leeuwd commented Oct 17, 2018

Check #91

@schmidt-sebastian
Copy link
Contributor

The issue pointed to by @leeuwd contains a sample for how to do this. I will add this to our JSDoc to make this obvious.

@leeuwd
Copy link

leeuwd commented Oct 18, 2018

For future reference and/or help others: if you use the credentials: {...} object to initialize Firestore and retrieve the client_email and private_key values from the Firebase environment configuration (e.g. values set with firebase functions:config:set someservice.key="THE API KEY"), you have to fix line endings:

functions.config().private_key

becomes

functions.config().private_key.replace(/\\n/g, '\n'),

Otherwise, you'll get Firebase cloud function errors like "routines:PEM_read_bio:no start line".

@google-cloud-label-sync google-cloud-label-sync bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Jan 31, 2020
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants