APIs we use on our website
Environment File Structure
This project uses two separate .env.local files:
| File | Purpose |
|---|---|
.env.local (root) |
Main Next.js app (Algolia, Etherscan, Matomo, etc.) |
src/data-layer/.env.local |
Data-layer module and Trigger.dev tasks (CoinGecko, Beaconcha.in, Dune, S3, etc.) |
Some variables like GITHUB_TOKEN_READ_ONLY and Sentry config are shared and should be set in both files.
See src/data-layer/.env.example for all data-layer-specific variables.
Main App API Keys
1. Add personal GitHub API token (free)
We recommend setting this up when running the project locally, as we use the GitHub API to fetch repository data for many projects & files.
- Follow these instructions to create a personal GitHub API token
- When selecting scopes in step 8, leave everything unchecked (the data we fetch doesn't require any scope)
- In local repo root directory: Make a copy of
.env.exampleand name it.env.local- Copy & paste your new GitHub API token into
.env.local
# .env.local Example:
GITHUB_TOKEN_READ_ONLY=48f84de812090000demo00000000697cf6e6a059
2. Add Etherscan API token (free)
- Create an account on Etherscan
- Navigate to your Account Settings page
- In the sidebar, click on 'API-KEYs' and add a new token
- Copy & paste your API-Key Token from Etherscan into
.env.local
# .env.local Example:
ETHERSCAN_API_KEY=K6NUTARFJZJCIXHF1F1E1YGJZ8RQ29BE4U