Cloudflare
Cloudflare account credentials and D1 setup required by EasyStarter
Cloudflare Integration
EasyStarter runs its server layer on Cloudflare infrastructure, mainly using:
- Cloudflare Workers
- Cloudflare D1
- Cloudflare R2
If you want to run database migrations, deploy the server, or configure object storage, you will usually need the Cloudflare credentials below first.
Required Environment Variables
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_API_TOKEN=CLOUDFLARE_ACCOUNT_ID: your Cloudflare account IDCLOUDFLARE_API_TOKEN: the API token used to call the Cloudflare API
These values are typically used by apps/server/drizzle.config.ts so drizzle-kit can run database commands over the D1 HTTP driver.
Get CLOUDFLARE_ACCOUNT_ID
Official doc: Find account and zone IDs
Option 1: From Account Home
- Sign in to the Cloudflare Dashboard.
- Open
Account Home. - Find your account row.
- Click the menu button on the right.
- Select
Copy account ID.
That copied value is your CLOUDFLARE_ACCOUNT_ID.
Option 2: From Workers & Pages
- Sign in to the Cloudflare Dashboard.
- Open
Workers & Pages. - Find
Account IDin theAccount detailssection. - Copy the value.
Get CLOUDFLARE_API_TOKEN
Official doc: Create API token
Use an API Token here, not the legacy Global API Key.
Create the token
- Sign in to the Cloudflare Dashboard.
- Go to
My Profile > API Tokens. - Click
Create Token. - Choose
Custom token. - Give it a clear name, such as
easystarter-d1-migrate. - Add these permissions:
Account->D1->EditAccount->Workers R2 Storage->EditAccount->Workers Scripts->Edit
- Scope the resources to the account used by this project.
- Click
Continue to summary. - Review the permissions and resource scope.
- Click
Create Token. - Copy the generated token secret.
That copied value is your CLOUDFLARE_API_TOKEN.
Notes
- the token secret is shown only once
- if you lose it, create a new token
- store it only in
.dev.vars,.env.production, or CI secrets
Where To Put Them
Place these variables in the apps/server directory as either .dev.vars or .env.production.
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_API_TOKEN=CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_API_TOKEN=