Created
June 7, 2020 23:59
-
-
Save bacongravy/8aaf497577cf5bc3b9df4177e6ef8b8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Firestore = require("@google-cloud/firestore"); | |
| let credentials = {}; | |
| try { | |
| credentials = JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT); | |
| } catch { | |
| console.error("Could not parse process.env.FIREBASE_SERVICE_ACCOUNT"); | |
| } | |
| module.exports = new Firestore({ projectId: credentials.project_id, credentials }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment