How to use Environmental or OS variables in self-created JavaScript files
问题 I created a helpers.js under <project_root>/static folder Inside this JS file, I have method which needs access to the environmental/OS variables. async function saveRegistration(pushSubscriptionObject) { let url = ""; try { url = `${process.env.GATSBY_FUNCTION_URL_BASE}${process.env.GATSBY_FUNCTION_UPDATE_SUBSCRIPTION}`; console.log("using netlify config: ", url); console.log("--------updateSub() url--------", url); } catch (ex) { console.log("saveReg() catch block:", JSON.stringify(ex));