**How do you read your environment variables from wrangler.toml in Cloudflare Functions?** When I

How do you read your environment variables from wrangler.toml in Cloudflare Functions?

When I run in the function I get:
const publishableKey = env.STRIPE_PUBLISHABLE_KEY


I get:
[wrangler:err] TypeError: Cannot read properties of undefined (reading 'STRIPE_PUBLISHABLE_KEY')


The function format is as following:
export async function onRequestGet(res, env, ctx) {  
// Code
}
Was this page helpful?