---
title: "Connect Wrangler"
---

> Documentation Index
> Fetch the complete documentation index at: https://ermahgerd-docs.t-bd7662a5eeb4.workers.ermahgerd.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Wrangler

Configure one shell or CI job for the installation and organization you intend
to use. All application guides assume this connection is already configured.

## Get your connection details

| Value                                           | Where to get it                                                                          |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Deployment API base URL, including `/client/v4` | The platform operator; a private listener requires the supplied network connection first |
| Organization ID                                 | Your organization overview in the tenant console; this is Wrangler's account ID          |
| Read-write API token                            | **Management → API tokens** in that organization; save the secret when it is shown       |

Managed-service customers arrange deployment connectivity with the operator
during alpha onboarding. Self-hosted operators choose that connectivity for
their installation. Only the [local demo](/self-hosted/local-demo/#local-endpoints)
uses the development loopback address and seeded credentials shown there.

## Configure your shell

Replace each placeholder with the value for your account. Keep tokens out of
source control and shared shell transcripts; use a CI secret store for builds.

```sh
export CLOUDFLARE_API_BASE_URL='<deployment-api-base-url>'
export CLOUDFLARE_ACCOUNT_ID='<organization-id>'
export CLOUDFLARE_API_TOKEN='<organization-read-write-token>'
```

The variable names are Wrangler's standard names. The API base URL selects
ermahgerd; do not leave it unset and accidentally target a different platform.
The tenant console origin, a Worker URL, and the S3 endpoint are different
interfaces and cannot be substituted for this API base URL.

From a project with Wrangler installed, check access:

```sh
npx wrangler deployments list --name my-worker
```

Use the name of an existing Worker for this read-only check. A newly created
organization has no deployments yet; proceed to [Deploy Workers](/build/workers/).
For reproducible builds, pin Wrangler in your project; the repository examples
carry their tested version in their lockfile.

## Troubleshoot the connection

* A connection error or timeout means the API endpoint is not reachable. Check
  the connection details and private network access with your operator.
* An authentication error means the token is missing, expired, revoked, or for
  a different installation.
* An authorization error can mean the token belongs to another organization,
  lacks write access, or is restricted to another Worker name.

Browser sessions do not supply Wrangler credentials. Do not use the platform
owner's bootstrap token as a customer's deployment credential.

Source: https://ermahgerd-docs.t-bd7662a5eeb4.workers.ermahgerd.io/build/connect-wrangler/index.mdx
