secrets: `.env.SECRET_NAME` or `context.env.SECRET_NAME`

I have a .dev.varslocally with some secrets, and Wrangler is telling me they're available, however in my worker I've tried both ${env.SECRET_NAME} and {context.env.SECRET_NAME}, neither of which is resolving. Does anyone know what might be the issue? Since the documentation mentions both approaches, I am suspicious that either might be incorrect.
2 Replies
Hello, I’m Allie!
Where are you trying to use the secrets?
endymion1818
endymion181810mo ago
Just solved it, thanks. I didn't realise I needed to get it from the incoming request
Want results from more Discord servers?
Add your server