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
Jürgen Leschner
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-L185
Cloudflare 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
xeon06
xeon06OP3mo ago
Oh that's a wonderful find @Jürgen Leschner , thank you!
Want results from more Discord servers?
Add your server