[PR #7647] [MERGED] feat: electron integration #24364

Closed
opened 2026-04-15 22:20:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7647
Author: @jslno
Created: 1/27/2026
Status: Merged
Merged: 2/4/2026
Merged by: @himself65

Base: canaryHead: feat/electron-integration


📝 Commits (10+)

📊 Changes

72 files changed (+7788 additions, -320 deletions)

View changed files

📝 .cspell/tech-terms.txt (+3 -1)
📝 .cspell/third-party.txt (+2 -0)
📝 biome.json (+1 -0)
demo/electron/.gitignore (+6 -0)
demo/electron/.npmrc (+3 -0)
demo/electron/README.md (+19 -0)
demo/electron/build/entitlements.mac.plist (+12 -0)
demo/electron/build/icon.icns (+0 -0)
demo/electron/build/icon.ico (+0 -0)
demo/electron/build/icon.png (+0 -0)
demo/electron/electron-builder.yml (+44 -0)
demo/electron/electron.vite.config.ts (+17 -0)
demo/electron/package.json (+50 -0)
demo/electron/resources/icon.png (+0 -0)
demo/electron/src/lib/auth-client.ts (+16 -0)
demo/electron/src/main/index.ts (+68 -0)
demo/electron/src/preload/index.d.ts (+6 -0)
demo/electron/src/preload/index.ts (+3 -0)
demo/electron/src/renderer/index.html (+16 -0)
demo/electron/src/renderer/src/App.tsx (+56 -0)

...and 52 more files

📄 Description

Summary by cubic

Adds official Electron integration for Better Auth to enable secure desktop auth via the system browser and deep-link callbacks. Includes a new @better-auth/electron package, a working Electron demo, and comprehensive docs.

  • New Features

    • New package: @better-auth/electron with server plugin electron(), electronClient() (IPC bridges incl. onUserUpdated), electronProxyClient(), and cookie/protocol utilities plus tests.
    • Demo app: demo/electron (electron-vite + React) with system-browser sign-in, deep-link callbacks, and build entitlements/CSP/icons.
    • Next.js demo: add electronProxyClient(), pass URLSearchParams to auth calls, and ensureElectronRedirect polling; server adds electron() and trustedOrigins for com.better-auth.demo:/.
    • Core/Workspace: export CookieAttributes and URL utils; add Electron build deps and lockfile updates.
  • Docs

    • New Electron integration guide with setup for server, web, and Electron app; sidebar entry and Electron icon added.

Written for commit 7fa1c913e7. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7647 **Author:** [@jslno](https://github.com/jslno) **Created:** 1/27/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/electron-integration` --- ### 📝 Commits (10+) - [`6960c9d`](https://github.com/better-auth/better-auth/commit/6960c9d051b65a2528ae3e157375d6f608068204) chore: export `CookieAttributes` - [`29f16df`](https://github.com/better-auth/better-auth/commit/29f16dfe6d41f467d680123b66ee80ad3349ee3e) chore: export url utils - [`5b9e9a9`](https://github.com/better-auth/better-auth/commit/5b9e9a9f6db5ddefe25bf5d12ae8e11ac0522333) feat: electron plugin - [`50d98f9`](https://github.com/better-auth/better-auth/commit/50d98f92f6dce79f5aae4d85b1e5d45151d4db27) docs: add docu for electron integration - [`1ee17fc`](https://github.com/better-auth/better-auth/commit/1ee17fcc46b935a24ae9631c0ba0debc9ace2e3e) chore: add electron demo - [`31bbf03`](https://github.com/better-auth/better-auth/commit/31bbf032d313690e8078c868e95ed4d84621dbaa) chore: fix linting - [`9344fb0`](https://github.com/better-auth/better-auth/commit/9344fb0487a9299b2729f630631b7ccd966ac46e) chore: fix dependencies - [`e2eca6f`](https://github.com/better-auth/better-auth/commit/e2eca6f6ae5bc3627b081775f1b0ff25c8bed3ea) chore: fix linting - [`6392795`](https://github.com/better-auth/better-auth/commit/6392795cc76643b04cd0c931ae862f1203790359) chore: add words to cspell - [`fed7a4b`](https://github.com/better-auth/better-auth/commit/fed7a4bd341058cdb34d1dc63ca03db0565b1d0c) chore: cleanup ### 📊 Changes **72 files changed** (+7788 additions, -320 deletions) <details> <summary>View changed files</summary> 📝 `.cspell/tech-terms.txt` (+3 -1) 📝 `.cspell/third-party.txt` (+2 -0) 📝 `biome.json` (+1 -0) ➕ `demo/electron/.gitignore` (+6 -0) ➕ `demo/electron/.npmrc` (+3 -0) ➕ `demo/electron/README.md` (+19 -0) ➕ `demo/electron/build/entitlements.mac.plist` (+12 -0) ➕ `demo/electron/build/icon.icns` (+0 -0) ➕ `demo/electron/build/icon.ico` (+0 -0) ➕ `demo/electron/build/icon.png` (+0 -0) ➕ `demo/electron/electron-builder.yml` (+44 -0) ➕ `demo/electron/electron.vite.config.ts` (+17 -0) ➕ `demo/electron/package.json` (+50 -0) ➕ `demo/electron/resources/icon.png` (+0 -0) ➕ `demo/electron/src/lib/auth-client.ts` (+16 -0) ➕ `demo/electron/src/main/index.ts` (+68 -0) ➕ `demo/electron/src/preload/index.d.ts` (+6 -0) ➕ `demo/electron/src/preload/index.ts` (+3 -0) ➕ `demo/electron/src/renderer/index.html` (+16 -0) ➕ `demo/electron/src/renderer/src/App.tsx` (+56 -0) _...and 52 more files_ </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds official Electron integration for Better Auth to enable secure desktop auth via the system browser and deep-link callbacks. Includes a new @better-auth/electron package, a working Electron demo, and comprehensive docs. - **New Features** - New package: @better-auth/electron with server plugin electron(), electronClient() (IPC bridges incl. onUserUpdated), electronProxyClient(), and cookie/protocol utilities plus tests. - Demo app: demo/electron (electron-vite + React) with system-browser sign-in, deep-link callbacks, and build entitlements/CSP/icons. - Next.js demo: add electronProxyClient(), pass URLSearchParams to auth calls, and ensureElectronRedirect polling; server adds electron() and trustedOrigins for com.better-auth.demo:/. - Core/Workspace: export CookieAttributes and URL utils; add Electron build deps and lockfile updates. - **Docs** - New Electron integration guide with setup for server, web, and Electron app; sidebar entry and Electron icon added. <sup>Written for commit 7fa1c913e75ced73899800bd842f23ddabe03afd. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:20:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#24364