Cloud functions for Open-Source Hub.
We use these to identify and track users in Open Source Hub by hooking onto Firestore lifecycle events.
You'll need the [email protected]
package installed globally:
npm i -g firebase-tools
Note that the structure of this repo differs from regular Node/JavaScript repos: there's no package.json
file at the root.
-
Clone the repo
-
Navigate into the
functions
directory and runyarn install
-
Create a
.env
file inside thefunctions
directory -
Add the required environment variables:
SEGMENT_WRITE_KEY="... find this in Segment"
-
Run the emulator:
yarn serve
TODO this is incomplete! How do we test the functions?
Run the command below at the root of the repo:
firebase deploy --only functions