Using environment variables in REST API resource

Hey everyone,

I'm adding a REST API resource which I'd like to use in my apps. I need to access an environment variable which will be used in one of the Javascript queries in the resource. I've tried using environment.variables.NAME as the docs suggest but that value never seems to be defined. I've tried defining an auth flow variable with the value of {{environment.variables.NAME}} with no luck. Both APP_ID and PRIVATE_KEY are not set to the environment variable. I've also tried using environment.variables.NAME within the Javascript too but again, no luck.

What am I doing wrong here?

Thanks :slight_smile:

I've logged out environment and it seems that the variables is an empty object. :thinking:

My config vars are set correctly and they're marked as secret.

Are you a part of the beta? Looks like a lil different than what @Tess shows here.

Or is this for selfhosted version?

Nope, just using the standard cloud version. I have access to configuration variables via the settings page

Maybe cause I'm on the free version, but I don't have it in my Settings.

Sorry I couldn't be of more help!

:thinking: it looks like config vars aren't supported in custom auth js at the moment, I'll bring it up with the dev team.

Thanks for surfacing this @alaa!

1 Like

Hey folks!

In case you missed it, config vars are now supported in custom auth js :tada: