Files
wr.do/content/docs/developer/cloudflare.mdx
T
2025-04-05 12:33:27 +08:00

31 lines
1.4 KiB
Plaintext

---
title: Cloudflare Configs
description: How to config the cloudflare api.
---
Before you start, you must have a Cloudflare account and be hosted on Cloudflare.
In this section, you can update these variables:
```js title=".env"
CLOUDFLARE_ZONE_ID=abcdef1234567890
CLOUDFLARE_API_KEY=1234567890abcdef1234567890abcdef
CLOUDFLARE_EMAIL=user@example.com
CLOUDFLARE_ZONE_NAME=wr.do
```
### Variable Descriptions
- **CLOUDFLARE_ZONE_ID**: This is the unique identifier for your Cloudflare zone. You can find it in the Cloudflare dashboard under the Overview section of your domain.
> Follow [this way](https://dash.cloudflare.com/Your_Acount_Id/wr.do), and scroll down to `Zone ID`.
- **CLOUDFLARE_API_KEY**: This is the API key that you use to authenticate requests to the Cloudflare API. You can generate or find your API key in the Cloudflare dashboard under the `profile` -> `api-tokens` section.
> Follow [https://dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens), and scroll down to `API Token`, the `Global API Key` should be used.
- **CLOUDFLARE_EMAIL**: This is the email address associated with your Cloudflare account. It is used for authentication alongside the API key.
- **CLOUDFLARE_ZONE_NAME**: This is the name of your Cloudflare zone. It is used to specify the zone in the Cloudflare API requests.