feat(init): support CLERK_PLATFORM_API_KEY for non-interactive auth#67
Conversation
44f798f to
b09f47f
Compare
Skip OAuth login when CLERK_PLATFORM_API_KEY is set in init and link. The PLAPI fetch helpers already use this key directly for API calls, so no token exchange is needed.
b09f47f to
2705d7d
Compare
Stack
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes modify authentication and linking workflows in two CLI commands. In 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
| } | ||
|
|
||
| async function authenticateAndLink(cwd: string): Promise<void> { | ||
| // If Platform API key is set, skip OAuth entirely |
There was a problem hiding this comment.
TIL: we can run clerk cli without a PLAPI
Summary
CLERK_PLATFORM_API_KEYenv var inclerk initandclerk linkfor non-interactive authenticationlinkalso bypasses token checks when the platform API key is present since PLAPI fetch helpers use it directlyTest plan
bun run testpassesbun run lintpassesclerk initworks with OAuth flow (existing behavior unchanged)CLERK_PLATFORM_API_KEY=<key> clerk initskips OAuth and links via API keySummary by CodeRabbit