Introduction
When working with Cloudflare Workers you sometimes need to use a feature which Cloudflare calls “Secrets” .
Creating a Secret
To create a “Secret” called “FOO” you do this …
$ wrangler secret put
FOO
… and you’ll get prompted for what value you want to associate with ‘FOO’.
Viewing a Secret via the Dashboard
The strange thing is that if you go into your Cloudflare dashboard there’s no sign of any “Secret”.
After a good deal of digging around I found the “Secret” I had created but it’s not referred to as “Secret” it’s labelled “Environment Variables”. That’s actually a better name for it than “Secret” but it’s pretty confusing and there’s no reference that I can find for it in the Cloudflare documentation.
In Detail
So just to be clear this is how you find your “Secret” …
- Logon to your Cloudflare dashboard
- Select ‘Workers’
- In the resulting list of ‘Workers’ select the one you create a ‘Secret’ for.
- In the resulting screen select “Settings”
- There are two options within “Settings”, they are “General” and “Variables”, select “Variables”
- Your “Secret” is now visible under the heading “Environmental Variables”.