diff --git a/app/app/context.py b/app/app/context.py index 8465cb8ad43..d20fa86a296 100644 --- a/app/app/context.py +++ b/app/app/context.py @@ -144,6 +144,8 @@ def preprocess(request): 'INFURA_V3_PROJECT_ID': settings.INFURA_V3_PROJECT_ID, 'giphy_key': settings.GIPHY_KEY, 'youtube_key': settings.YOUTUBE_API_KEY, + 'fortmatic_live_key': settings.FORTMATIC_LIVE_KEY, + 'fortmatic_test_key': settings.FORTMATIC_TEST_KEY, 'orgs': profile.organizations if profile else [], 'profile_id': profile.id if profile else '', 'hotjar': settings.HOTJAR_CONFIG, diff --git a/app/app/local.env b/app/app/local.env index e24f9f59bd7..2170d73d3fa 100644 --- a/app/app/local.env +++ b/app/app/local.env @@ -41,4 +41,6 @@ CONTACT_EMAIL= FEE_ADDRESS= FEE_ADDRESS_PRIVATE_KEY= GIPHY_KEY= -YOUTUBE_API_KEY= \ No newline at end of file +YOUTUBE_API_KEY= +FORTMATIC_LIVE_KEY= +FORTMATIC_TEST_KEY= \ No newline at end of file diff --git a/app/app/settings.py b/app/app/settings.py index a9c143c2112..852f80d0de5 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -52,6 +52,8 @@ #social integrations GIPHY_KEY = env('GIPHY_KEY', default='LtaY19ToaBSckiLU4QjW0kV9nIP75NFy') YOUTUBE_API_KEY = env('YOUTUBE_API_KEY', default='YOUR-SupEr-SecRet-YOUTUBE-KeY') +FORTMATIC_LIVE_KEY = env('FORTMATIC_LIVE_KEY', default='YOUR-SupEr-SecRet-LiVe-FoRtMaTiC-KeY') +FORTMATIC_TEST_KEY = env('FORTMATIC_TEST_KEY', default='YOUR-SupEr-SecRet-TeSt-FoRtMaTiC-KeY') # Ratelimit RATELIMIT_ENABLE = env.bool('RATELIMIT_ENABLE', default=True) diff --git a/app/assets/v2/js/shared.js b/app/assets/v2/js/shared.js index 72b65cd4a74..2cfb855a5f5 100644 --- a/app/assets/v2/js/shared.js +++ b/app/assets/v2/js/shared.js @@ -1086,8 +1086,7 @@ $(document).ready(function() { const Web3Connect = window.Web3Connect.default; // Determine if we're on prod or not const isProd = document.location.href.startsWith('https://gitcoin.co'); - // FIXME: Use Fortmatic API key provided by Gitcoin - const formaticKey = isProd ? 'pk_live_99CEDFB950A446EC' : 'pk_test_A9E82CC253A9C8E4'; + const formaticKey = isProd ? document.contxt['fortmatic_live_key'] : document.contxt['fortmatic_test_key']; const providerOptions = { authereum: { 'package': Authereum diff --git a/docs/ENVIRONMENT_VARIABLES.md b/docs/ENVIRONMENT_VARIABLES.md index bc2ad16349c..48aa630566c 100644 --- a/docs/ENVIRONMENT_VARIABLES.md +++ b/docs/ENVIRONMENT_VARIABLES.md @@ -48,6 +48,13 @@ All of the environment variables used by this application conform to the [`djang | --- | --- | --- | --- | | INSTALLED_APPS | A list of additional apps to be recognized by Django. | `list` | [] | +## Fortmatic + +| Variable | Description | Type | Default | +| --- | --- | --- | --- | +| FORTMATIC_LIVE_KEY | The Formatic live (production) API key | `str` | '' | +| FORTMATIC_TEST_KEY | The Formatic test API key | `str` | '' | + ## Github Authentication | Variable | Description | Type | Default | diff --git a/docs/THIRD_PARTY_SETUP.md b/docs/THIRD_PARTY_SETUP.md index 6bc03f37a2b..1a96436113d 100644 --- a/docs/THIRD_PARTY_SETUP.md +++ b/docs/THIRD_PARTY_SETUP.md @@ -56,6 +56,16 @@ CONTACT_EMAIL=xxx ENABLE_NOTIFICATIONS_ON_NETWORK=None ``` +## Setup Fortmatic Integration + +1. Sign up/Login to Fortmatic dashboard at https://dashboard.fortmatic.com +2. Update the `web/app/app/.env` file to include the values provided by Fortmatic: + +```shell +FORTMATIC_LIVE_KEY=xxx +FORTMATIC_TEST_KEY=xxx +``` + ## Gitcoinbot Installation Instructions ### This integration requires the Github OAuth2 App Integration