Add Electron to `clerk init` framework detection and `--framework`
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- electron, typescript
- Domain
- cli
Research direction
Start with packages/cli-core/src/lib/framework.ts and its FRAMEWORK_MAP, then inspect packages/cli-core/src/commands/env/pull.ts and the init flow. Verify Electron Forge projects are detected as Electron, the Electron SDK and publishable-key environment settings are selected, and CLERK_SECRET_KEY is omitted; check whether starter behavior and existing tests also need updates.
Written by the indexing model from the issue text.
Description
Summary
clerk init cannot set up @clerk/electron. --framework has no electron choice, and detection (packages/cli-core/src/lib/framework.ts FRAMEWORK_MAP) matches an Electron Forge project as React once react is installed (React precedes Vite in the map) or as Vite/JavaScript before that, so init installs @clerk/react or @clerk/clerk-js. clerk env pull writes the right variable name (VITE_CLERK_PUBLISHABLE_KEY) but also writes CLERK_SECRET_KEY, because packages/cli-core/src/commands/env/pull.ts includes the secret key for every npm framework. A secret key has no use in an Electron app, so the docs cannot recommend env pull either.
The Electron docs (clerk/clerk#3382) therefore use the manual Publishable Key step and carry no CLI instructions.
Proposal
Add an entry to FRAMEWORK_MAP before the react and vite entries, since Electron Forge projects contain both:
{
dep: "electron",
name: "Electron",
sdk: "@clerk/electron",
envVar: "VITE_CLERK_PUBLISHABLE_KEY",
envFile: ".env",
},
Notes for the implementer:
@clerk/electronneedselectron-storeinstalled alongside it (optional peer used by@clerk/electron/storage);sdkInstallmay need to cover both.- Electron has no secret key;
initandenv pullshould skipCLERK_SECRET_KEYfor this framework the way the iOS and Android entries do (extendisNpmFramework/includeSecretKeyor add a per-framework flag). - The Electron renderer's Content Security Policy needs the instance's Frontend API host; the docs put it in
.envasVITE_CLERK_FRONTEND_API_HOST, whichenv pullcould write too. --startercould scaffold with Electron Forge:npm init electron-app@latest <name> -- --template=vite-typescriptplus React, matching the docs quickstart at https://clerk.com/docs/electron/getting-started/quickstart.- Keyless is not supported by the Electron SDK today (the SDK requires
publishableKey).
Follow-up in docs
Once shipped, the quickstart gains a "For AI agents" block with npx clerk@latest init --framework electron and a <PromptOnly> card (tracked in Linear DOCS, linked from the docs PR).
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 5
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from clerk/cli
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Maintainers usually reply within 2 days
-
when i type clerk initPossibly taken @wyattjoh claimed this 32 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 2 days
-
Adding support for multiple workspacesMay be free again @wyattjoh claimed this 102 days ago, and no pull request is open. Open
clerk/cli#365 · 2 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Maintainers usually reply within 2 days
Similar issues
-
area: desktop area: website priority: P2 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
appandflow/stim#3411 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rjsf-team/react-jsonschema-form#5485 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 65/100
lingdojo/kana-dojo#32090 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Friction: Org home and org switcher copy still say repositories and connected agents live in the personal accountPossibly taken A pull request linked to this issue is open or already merged. Openfriction
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
kentcdodds/kody#3265 ·
Maintainers usually reply within 1 day