Accessing cloudflare env without fetch

I have a symmetrical key system for JWT. Both keys stored using cloudflare secrets for production and a separate set of keys for development. I would prefer to initialize JWT with the keys efficiently without doing an if check on each request if the keys were already setup
1 Reply
DebianArch
DebianArch11mo ago
example of what I want to end up doing, but hopefully not in the fetch function: const privateKey = await jose.importPKCS8(PRIVATE_KEY, alg) const publicKey = await jose.importSPKI(PUBLIC_KEY, alg)