From 4ddbfae4fecc54a5d1882ab93e1ae4e85594a18c Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Tue, 21 Apr 2026 15:23:01 -0400 Subject: [PATCH] Allow overriding Airtable base IDs via env vars Introduce REACT_APP_AIRTABLE_BASE and REACT_APP_AIRTABLE_CENSUS_BASE env vars with the existing ELA production IDs as fallbacks. The upstream ELA Airtable bases are private, so contributors without access cannot run the app locally against real data. With this change they can duplicate the schema into their own workspace and point the local dev build at it via .env, while the default behavior for anyone with access to the ELA bases is unchanged. Also document the two new vars in sample.env. --- sample.env | 8 ++++++++ src/components/config/api.ts | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sample.env b/sample.env index 39b7f545..cdc3427d 100644 --- a/sample.env +++ b/sample.env @@ -8,3 +8,11 @@ REACT_APP_SENTRY_ENVIRONMENT='your_sentry_env_name' # Airtable API REACT_APP_AIRTABLE_API_KEY='your_airtable_api_key' + +# Optional Airtable base overrides. If unset, the ELA production base IDs +# hardcoded in src/components/config/api.ts are used. Contributors who do +# not have access to the official ELA bases can duplicate the schema into +# their own workspace and set the corresponding env var here to point the +# local dev build at it. +REACT_APP_AIRTABLE_BASE='' +REACT_APP_AIRTABLE_CENSUS_BASE='' diff --git a/src/components/config/api.ts b/src/components/config/api.ts index 7ae08fad..58f8bdb9 100644 --- a/src/components/config/api.ts +++ b/src/components/config/api.ts @@ -1,8 +1,10 @@ import { RouteLocation } from './types' export const AIRTABLE_API_KEY = process.env.REACT_APP_AIRTABLE_API_KEY as string -export const AIRTABLE_BASE = 'applPEl3BsnpuszQu' -export const AIRTABLE_CENSUS_BASE = 'appjb6Qnp4lTNz7Gn' +export const AIRTABLE_BASE = + process.env.REACT_APP_AIRTABLE_BASE || 'applPEl3BsnpuszQu' +export const AIRTABLE_CENSUS_BASE = + process.env.REACT_APP_AIRTABLE_CENSUS_BASE || 'appjb6Qnp4lTNz7Gn' // TODO: get this into provider/global so it doesn't need adding every time export const reactQueryDefaults = {