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.)
Non-interactive auth
Section titled “Non-interactive auth”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.
Install wrangler
Section titled “Install wrangler”npm install -g wranglerwrangler --versionThe 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.
Token scopes for wrangler
Section titled “Token scopes for wrangler”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.
