Cloudflare Worker Deployment: Manual
For a simple, one-time setup without additional tooling, you can manually deploy your worker via the Cloudflare Dashboard.
-
Download the worker code:
- Go to the GitHub releases page for
email-gateway-cloudflare. - Find the release corresponding to the latest version of
@email-gateway/cloudflare-worker. - Download
dist.zipfrom the Assets section, which containsworker.js.
- Go to the GitHub releases page for
-
Access Cloudflare Dashboard:
- Log in to your Cloudflare Dashboard.
- Navigate to Workers & Pages → Create Application → Create Worker.
-
Upload the code:
- Replace the default code in the editor with the contents of the downloaded
worker.jsfile. - Click Save and Deploy.
- Replace the default code in the editor with the contents of the downloaded
-
Configure Environment Variables:
- Go to Settings → Variables and Secrets.
- Under "Environment Variables", add a new variable:
- Variable name:
EMAIL_OPTIONS - Value: Paste your
EMAIL_OPTIONSJSON string (e.g.,{"default_email_address":"your-real-email@gmail.com","ignore_email_checks":["trusted-receiver@example.com"]}).
- Variable name:
-
Set Secrets:
- In the same Variables and Secrets section, under "Secrets", add a new secret:
- Secret name:
EMAIL_SECRET_MAPPING - Value: Paste your
EMAIL_SECRET_MAPPINGJSON string (e.g.,{"secret1": "user1@gmail.com", "secret2": "user2@gmail.com"}).
- Secret name:
- In the same Variables and Secrets section, under "Secrets", add a new secret:
-
Configure Email Routing: (This step is common to all deployment methods and is detailed in the next section.)