Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit c4359c4

Browse files
authored
Merge pull request #23 from uniquelyparticular/feat/secureFirestore
feat: Added secure firestore, fix: now deployment issues w npm vs yarn
2 parents 61f63f9 + 9a82cb1 commit c4359c4

File tree

6 files changed

+801
-14496
lines changed

6 files changed

+801
-14496
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ Create a `.env` at the project root with the following credentials:
2525

2626
```dosini
2727
DEPLOYED_URI
28-
FIREBASE_API_KEY
2928
FIREBASE_PROJECT_ID
29+
FIREBASE_CLIENT_ID
30+
FIREBASE_PRIVATE_KEY_ID
31+
FIREBASE_PRIVATE_KEY
3032
SHOPIFY_OAUTH_SCOPES
3133
SHOPIFY_API_KEY
3234
SHOPIFY_API_SECRET
@@ -36,7 +38,17 @@ SHOPIFY_API_SECRET
3638

3739
`DEPLOYED_URI` should be set to your `ngrok URL` from above (ie. `https://312a9670.ngrok.io`)
3840

39-
Open the [Firebase Console](https://console.firebase.google.com) to create a new Project (or you can use an existing one) to use for storing temporary nonce date. Click `Add Project`, enter anything in the `Project Name` field then click `Create Project`. When you receive the 'Your new project is ready' confirmation, click `Continue`. Under the 'Get started by adding Firebase to your app', click the icon for `Web` < /> and then in that popup you will find your configuration information to use for `FIREBASE_API_KEY` (apiKey) and `FIREBASE_PROJECT_ID` (projectId).
41+
Open the [Firebase Console](https://console.firebase.google.com) to create a new Project (or you can use an existing one) to use for storing temporary nonce date. Click `Add Project`, enter anything in the `Project Name` field then click `Create Project`. When you receive the 'Your new project is ready' confirmation, click `Continue`.
42+
43+
Go into the `Settings` for your new project (click gear icon) and click on `Service Accounts` tab. Click the `Generate new private key` button to download a JSON file containing your Service Account credentials.
44+
45+
From that JSON file, copy the following to your env entries:
46+
`project_id` >> `FIREBASE_PROJECT_ID`
47+
`client_id` >> `FIREBASE_CLIENT_ID`
48+
`private_key_id` >> `FIREBASE_PRIVATE_KEY_ID`
49+
50+
Grab the value of the key containing between `-----BEGIN PRIVATE KEY-----` and `-----END PRIVATE KEY-----\n` to set as the value of `FIREBASE_PRIVATE_KEY`
51+
\*If deploying to Zeit Now instead of ngrok, make sure to replace `\n` in the string w/ `\\n` before storing as a secret.
4052

4153
---
4254

now.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"SHOPIFY_OAUTH_SCOPES": "@demo-shopify-oauth-scopes",
99
"SHOPIFY_API_KEY": "@demo-shopify-api-key",
1010
"SHOPIFY_API_SECRET": "@demo-shopify-api-secret",
11-
"FIREBASE_API_KEY": "@demo-firebase-api-key",
12-
"FIREBASE_PROJECT_ID": "@demo-firebase-project-id"
11+
"FIREBASE_PROJECT_ID": "@particular-firebase-project-id",
12+
"FIREBASE_CLIENT_ID": "@particular-firebase-client-id",
13+
"FIREBASE_PRIVATE_KEY_ID": "@particular-firebase-pk-id",
14+
"FIREBASE_PRIVATE_KEY": "@particular-firebase-pk"
1315
},
1416
"routes": [{ "src": "/(.*)", "dest": "/src" }],
1517
"builds": [

0 commit comments

Comments
 (0)