You need to obtain and configure each of the environment variables, that define Your configuration between the required services:
There are 2 configuration files one for production and one for development + additional configuration should be done via netlify .env service – learn more here.
Each of those files has the following contents:
.env
GATSBY_PROJECT_NAME="superfunky"
FRONTEND_DOMAIN=superfunky.pro
BACKEND_DOMAIN=wp.superfunky.pro
WPGRAPHQL_URL=https://wp.superfunky.pro/graphql
PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_XXX
STRIPE_SECRET_KEY=sk_test_XXX
STRIPE_WEBHOOK_SECRET=whsec_XXX
STRIPE_ID=acct_XXX
MG_API_KEY=XXX
.env.development
Note the test Stripe keys and localhost url, the rest remain unchanged
GATSBY_PROJECT_NAME="superfunky"
FRONTEND_DOMAIN=superfunky.pro
BACKEND_DOMAIN=wp.superfunky.pro
WPGRAPHQL_URL=https://wp.superfunky.pro/graphql
PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_XXX
STRIPE_SECRET_KEY=sk_test_XXX
STRIPE_WEBHOOK_SECRET=whsec_XXX
STRIPE_ID=acct_XXX
MG_API_KEY=XXX
Explanations
Each key corresponds to the required service and is responsible for communication between them.
GATSBY_PROJECT_NAME
– Your company’s name- FRONTEND_DOMAIN – Your gatsby site’s domain or subdomian
BACKEND_DOMAIN
– Your wordpress backend’s domain or subdomain- WPGRAPHQL_URL – backend graphql api endpoint, can be setup in plugin’s settings.
PUBLIC_STRIPE_PUBLISHABLE_KEY
– Stripe public keySTRIPE_SECRET_KEY
– Stripe secret keySTRIPE_WEBHOOK_SECRET
– Stripe webhook secretSTRIPE_ID
– Stripe account IDMG_API_KEY
– Mailgun API key for Autoresponders
Additional notes on using ENV variables in JSX for mapping of variables
https://chatgpt.com/share/680be648-cbbc-8007-8464-fa9937ec9503