Skip to content

Commit

Permalink
Merge pull request #453 from ethereum/expand-docs
Browse files Browse the repository at this point in the history
Expand docs
  • Loading branch information
samajammin authored Oct 28, 2021
2 parents c55703d + 7e0f8dd commit 42b442c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/brightid.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ VUE_APP_BRIGHTID_CONTEXT={CONTEXT}
BRIGHTID_CONTEXT={CONTEXT}
```

Note: the BrightID context is specific to the BrightID network - it's independent from the Ethereum network you choose to run the app on. It refers to the BrightID app context where you want to burn sponsorship tokens. For instance, you could use the production `clr.fund` context on xDAI or Arbitrum (or any network).

[Learn more about context in the BrightID docs](https://dev.brightid.org/docs/guides/ZG9jOjQxNTE1NDU-basic-integration).

## Testing

The following tool provided by BrightID is used for manual linking, sponsoring, and verifying a contextId (in our case, the user wallet address).
Expand Down
31 changes: 31 additions & 0 deletions docs/google-sheets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Google Sheets integration

An optional feature when running a round as an admin is collect contact email addresses and to pipe recipient application data to a Google Sheet. This can help facilitate coordination with round recipients, e.g. if you'd like to notify recipients of round updates (such as the launch of a new round) or to perform KYC on applicants before adding them to the recipient registry.

**Note: this is only available if using the optimistic recipient registry and the frontend application is deployed via Netlify.**

## How it works

If you'd like to use this feature, you must add the Google Sheet environment variables in `vue-app/.env`. If no Google Sheet credentials are provided in `vue-app/.env`, the `email` field on the recipient Join form will not be displayed and the integration will be disabled.

Two new env variables must be added:

- `GOOGLE_APPLICATION_CREDENTIALS`: service account credentials in a json string
- `GOOGLE_SPREADSHEET_ID`: the spreadsheet id that is going to be used

[Learn more about setting up Google authentication credentials](https://cloud.google.com/docs/authentication/getting-started).

If the environment variables are present, we send the form data to a Netlify function (which uses AWS Lambda under the hood). The Netlify function uses the API wrapper `google-spreadsheet` to pipe the data to your Google Sheet.

You can view the function logic in `vue-app/lambda/recipient.js`.

## Testing locally

In order to test it, you need to install the Netlify CLI (https://docs.netlify.com/cli/get-started/) in your machine, it is not included in the deps. Once you have that:

1. install everything by running `yarn`
2. run `yarn start:node` in one terminal
3. run `yarn deploy:local` in a different terminal
4. run `netlify dev` in a different terminal in the vue-app folder

With that, you will have the lambda functions in `/.netlify/functions/{function}`.
1 change: 1 addition & 0 deletions vue-app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ VUE_APP_CLRFUND_FACTORY_ADDRESS=0x5FC8d32690cc91D4c39d9d3abcBD16989F875707
# Supported values: simple, brightid
VUE_APP_USER_REGISTRY_TYPE=simple
# clr.fund (prod) or CLRFundTest (testing)
# Learn more about BrightID and context in /docs/brightid.md
VUE_APP_BRIGHTID_CONTEXT=clr.fund

# Supported values: simple, optimistic, kleros
Expand Down

0 comments on commit 42b442c

Please sign in to comment.