This guide will show how to sync secrets from Doppler to Cloudflare Workers.
- Experience with Cloudflare Worker secrets
- Wrangler CLI installed and authenticated
- The jq CLI installed
You'll need to perform the one-time operation of adding your secrets from Cloudflare to Doppler before continuing as there is no way to export your current secrets using the Wrangler API.
To sync your secrets to Cloudflare as part of a CI/CD job e.g. GitHub Actions, the Doppler CLI requires a Service Token to provide read-only access to a specific config and is exposed to the CLI via the
DOPPLER_TOKEN environment variable. This would normally be set by the environment, e.g GitHub Secret, but for this guide, we'll provide it manually.
You can upload your secrets to Cloudflare using the below command:
wrangler secret:bulk <(doppler secrets --json | jq -c 'with_entries(.value = .value.computed)')
You should see a confirmation message in your shell for every secret synced to Cloudflare.
Now you know to use Doppler to easily sync secrets to Cloudflare Workers in CI/CD environments.
Updated 5 months ago