Skip to content

[Workers] Document Wrangler auth profiles#31774

Draft
MattieTK wants to merge 2 commits into
productionfrom
wrangler-auth-profiles
Draft

[Workers] Document Wrangler auth profiles#31774
MattieTK wants to merge 2 commits into
productionfrom
wrangler-auth-profiles

Conversation

@MattieTK

Copy link
Copy Markdown
Member

Summary

Adds user-facing documentation for Wrangler authentication profiles (workers-sdk #14200, RFC #14161).

Profiles let you keep separate OAuth logins scoped to specific accounts and bind them to directories, so you can work across multiple Cloudflare accounts without re-running wrangler login — for example, a separate login per client at an agency, or account-separated staging and production with account_id as a failsafe.

This PR adds:

  • A new guide at /workers/wrangler/profiles/ covering when to use profiles, the resolution order, account selection, and the create / activate / switch / list / remove workflow.
  • A changelog entry (dated 2026-06-30) that summarises the use cases and links to the guide.

Before merging — update Wrangler in this repo. The wrangler auth command reference (auth create, auth activate, auth deactivate, auth list, auth delete) autogenerates from the installed wrangler package via experimental_getWranglerCommands(). These commands are not in any published Wrangler yet — the latest is 4.105.0, and the feature merged after it, shipping in 4.106.0. Once 4.106.0 is on npm:

  • Bump the wrangler devDependency in package.json.
  • Add the <WranglerCommand command="auth …" headingLevel={3} /> entries under the auth section in commands/general.mdx so the command reference populates (this also renders the --profile global flag and the "Experimental" badge automatically).

The guide currently links to the #auth section anchor, which already exists, so internal links resolve in the meantime. The changelog date should also be confirmed against the actual 4.106.0 release date.

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes. (Tracked by RFC #14161.)

@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners
/src/content/docs/workers/wrangler/ @cloudflare/wrangler, @irvinebroque, @cloudflare/product-owners, @MattieTK, @vy-ton

@ask-bonk

ask-bonk Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Recommended labels: workers, wrangler, documentation, changelog

Summary

This PR adds user-facing documentation for Wrangler authentication profiles (shipping in Wrangler 4.106.0):

  • New guide: src/content/docs/workers/wrangler/profiles.mdx — a concept page covering profile resolution order, directory binding, account selection, and the create / activate / switch / list / remove workflow.
  • Changelog entry: src/content/changelog/workers/2026-06-30-wrangler-auth-profiles.mdx announcing the feature and linking to the guide.

Overall, the content is well-structured, provides practical examples (agency multi-client work and staging/production separation), and appropriately flags the beta status. Good work.


Issues that need attention before merge

1. Grammar typo in profiles.mdx (line 11) 🔴
The opening sentence is missing a conjunction.

- A profile is a named OAuth login that you scope to a chosen set of accounts can bind to a directory.
+ A profile is a named OAuth login that you scope to a chosen set of accounts and bind to a directory.

2. Pre-merge dependency: Wrangler version bump 🔴
As noted in the PR description, the wrangler devDependency must be bumped to 4.106.0 and the <WranglerCommand> entries for auth create, auth activate, auth deactivate, auth list, and auth delete must be added to commands/general.mdx before this merges. Without that bump, the command reference anchor exists but the specific commands won't render.

3. Changelog date confirmation 🔴
The changelog date is set to 2026-06-30. This should be updated to match the actual 4.106.0 release date before merge.

4. Consider adding sidebar.order
The new guide does not set a sidebar.order. Without one, it will be sorted alphabetically among the Wrangler pages. If it should appear in a specific position (e.g., near Install/Update or Configuration), add an explicit sidebar: order: N to the frontmatter.

5. <Steps> usage for priority lists
The Resolution order and Account selection sections use the <Steps> component for declarative priority lists rather than procedural instructions. The style guide typically reserves <Steps> for sequential actions ("Do X, then do Y"). Consider using a regular numbered markdown list for these two sections, or rephrasing the items as imperative steps.

6. Unchecked documentation checklist item
The third checklist item ("If a larger change … an issue has been opened …") is unchecked, with a note that it is tracked by RFC #14161. If maintainers are satisfied that the RFC is sufficient, this is fine.


Verdict

Approve after addressing items 1–3 (grammar fix, wrangler bump, and date confirmation). The rest are optional suggestions.

github run

@irvinebroque irvinebroque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏 👏

stamp so you have it, see comments

worth considering calling out in blog too (but not blocking on blog)

Comment thread src/content/changelog/workers/2026-06-30-wrangler-auth-profiles.mdx Outdated
- workers
date: 2026-06-30
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want a "You can now..." sentence here so that this leads with what you can now do, rather than starting with what you used to not be able to do


A profile is a named OAuth login that you scope to a chosen set of accounts and bind to a directory. Commands run in that directory, and its subdirectories, use the matching account automatically.

Use profiles to keep a separate login for each client when working at an agency, or to separate staging and production into different accounts. Pair a profile with an `account_id` in your [Wrangler configuration file](/workers/wrangler/configuration/) so a command cannot reach the wrong account.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dinasaur404 for blog re: FGA

wrangler deploy --profile personal
```

In CI and other automated environments, `CLOUDFLARE_API_TOKEN` still takes precedence over all profiles.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only true in non-interactive environments, or is it always the case regardless of env?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the case regardless so we can probably remove this line, it's more for safety to be like "don't worry, this won't interfere".

Co-authored-by: Brendan Irvine-Broque <brendanib@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants