Set secrets via HTTP
Is there any way to set a worker secret via HTTP? I see there's something for Worker Platform but not finding much for workers except for the wrangler command, but I want to do it through code...
2 Replies
I don't see it in the API docs, but it looks like wrangler uses this api to PUT a json object with {"name":"<key>", "text":"<value>", "type":"secret_text"}
/accounts/account_id/workers/scripts/script_name/secrets
https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/secret/index.ts#L170-L185Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
GitHub
workers-sdk/packages/wrangler/src/secret/index.ts at main · cloudfl...
⛅️ Home to Wrangler, the CLI for Cloudflare Workers® - cloudflare/workers-sdk
Oh that's a wonderful find @Jürgen Leschner , thank you!