EasyStarter logoEasyStarter

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 ID
  • CLOUDFLARE_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

  1. Sign in to the Cloudflare Dashboard.
  2. Open Account Home.
  3. Find your account row.
  4. Click the menu button on the right.
  5. Select Copy account ID.

That copied value is your CLOUDFLARE_ACCOUNT_ID.

Option 2: From Workers & Pages

  1. Sign in to the Cloudflare Dashboard.
  2. Open Workers & Pages.
  3. Find Account ID in the Account details section.
  4. 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

  1. Sign in to the Cloudflare Dashboard.
  2. Go to My Profile > API Tokens.
  3. Click Create Token.
  4. Choose Custom token.
  5. Give it a clear name, such as easystarter-d1-migrate.
  6. Add these permissions:
    • Account -> D1 -> Edit
    • Account -> Workers R2 Storage -> Edit
    • Account -> Workers Scripts -> Edit
  7. Scope the resources to the account used by this project.
  8. Click Continue to summary.
  9. Review the permissions and resource scope.
  10. Click Create Token.
  11. 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.

apps/server/.dev.vars
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_API_TOKEN=
apps/server/.env.production
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_API_TOKEN=