Skip to content

How wrangler authenticates

The integration shells out to wrangler — Cloudflare’s CLI — to deploy Pages and Containers. (R2 provisioning and custom-domain DNS use the REST API directly and don’t need wrangler.)

You do not run wrangler login. The integration passes your credentials to wrangler as environment variables, which is the supported way to authenticate in CI and automation:

Variable Value
CLOUDFLARE_API_TOKEN Your scoped API token.
CLOUDFLARE_ACCOUNT_ID Your account ID.

These are the same values the rest of the integration uses, so setting them once is enough. When you run aspire deploy, the integration sets them on the wrangler process for you.

Terminal window
npm install -g wrangler
wrangler --version

The integration calls whatever wrangler is on your PATH. If wrangler is missing when a Pages/Container deploy runs, you’ll get a clear error pointing you here.

The token needs the permissions for whatever wrangler deploys:

  • Pages: Cloudflare Pages: Edit
  • Workers / Containers: Workers Scripts: Edit

These are the same rows from API Tokens & Scopes — one token covers both the integration’s REST calls and wrangler.