clerk / clerk/cli

Auth: support multiple platform environments (per-host credential profiles)

Open
#329 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
55
Forks
5
Avg merge
1d 16h
Merged PRs (30d)
17

Description

While dogfooding the CLI (1.5.0, agent-driven) against a second Clerk platform environment, we hit a wall on auth: CLERK_PLATFORM_API_URL cleanly redirects requests, but the credential store only holds one OAuth token and clerk auth login has no notion of which host a token belongs to. Logging into the alternate environment would clobber the production login, so the only safe path is minting a platform API key for the second environment and threading CLERK_PLATFORM_API_KEY through every call.

That workaround is fine for CI but makes non-production work second-class for interactive use. A per-host credential store (key tokens by platform API URL) or an explicit --profile on auth login/api/config would make switching environments first-class. Bonus: clerk doctor could report which environment the stored token belongs to.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the credential store and the clerk auth login, api, and config command entry points described in the issue. Clarify whether per-host credentials or explicit profiles is the intended design, then verify that separate environments can be used without overwriting each other and that the relevant commands select the correct credentials.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.