Typescript repl not finding Secrets for app

I have a typescript project that expects secrets in the .env file. I placed the files in the Secrets section, verified the key names and values are correct, but each time my app starts up in npm run dev, the secret is not found by the app. It is defined in the application page with process.env like this in the app:

const openAiKey = process.env.OPENAI_KEY

How can I get my app to read the Secret in the repl?

Just to make sure, you are using node right? Try running echo $YOUR_SECRET_NAME to see if your secret even saved.

1 Like

That only returns an empty line. I have closed my shells and other sections repeatedly.

This means you have not saved your secret properly. Try making sure you have clicked “save” and have the right name in the secret, your code and the command.

They are there but they do not get accessed by the code. I figured out I have to add the secrets with export VAR=foo and it works.

1 Like

Can you show a screenshot of this? (With the secret values removed of course)