When checking for this public variable, you want to check for "NEXT_PUBLIC_ASSETS_URL" instead of just "ASSETS_URL", depending on the technology.
You might want smth like so:
add an map const clientPrefixes = { [AppNames.SURVEYFORM]: "NEXT_PUBLIC_", [AppNames.RESULTS]: "XX_" } (I don't remember the syntax for Gatsby?)
add a "client" field to the relevant env variables
when checking for those variable, add the prefix to the name
rethink the env variable access logic => currently it would leak server code while here we want only prefixed values, that's the hard part
I've temporarily fixed the surveyform, using the old public config system
@SachaG just to keep track of this, see my latest commit: https://github.com/Devographics/Monorepo/commit/78dce79ef023783a495e1dade7ecdc6566b5d9b6
When checking for this public variable, you want to check for "NEXT_PUBLIC_ASSETS_URL" instead of just "ASSETS_URL", depending on the technology. You might want smth like so:
const clientPrefixes = { [AppNames.SURVEYFORM]: "NEXT_PUBLIC_", [AppNames.RESULTS]: "XX_" }
(I don't remember the syntax for Gatsby?)I've temporarily fixed the surveyform, using the old public config system