Files
accountkit/package.json
T
CatoandClaude e282d1e6e4 feat(auth): Lightning login (LNURL-auth, LUD-04), opt-in per deployment (#75)
A free, Bitcoin-native way in: the person's own Lightning wallet signs a
one-time challenge shown as a QR code (or opened through a lightning: link on
the same device). No key, no third party, nothing paid. The signed key is a
sign-in method (providerId "lightning"), never an email.

- /lightning/start mints a challenge (five minutes, used once) and binds it
  to the asking browser with a signed cookie; /lightning/callback is the
  wallet's LUD-04 call and checks the DER secp256k1 signature of k1;
  /sign-in/lightning (polled) signs in or creates the person;
  /lightning/link adds a wallet to the signed-in person, never one that
  already signs in to someone else.
- A second factor applies; minting and the wallet's call spend the
  credential bucket.
- SignInForm and SignUpForm offer "Sign in with a Lightning wallet",
  AccountPanel "Add Lightning wallet"; words in all six languages.
- Off until ACCOUNTKIT_LIGHTNING=1.

Tests: LUD-01's own LNURL both ways, a signature made by OpenSSL, and the
whole flow on a real database (PGlite) with a wallet that signs as LUD-04
says: sign-in and sign-in again, a forged signature, an onlooker without the
browser's cookie, a second factor, linking and a taken wallet, and nothing
mounted without the opt-in. Browser: QR, wallet link, 44px, no sideways
scroll at 320 and 390px.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 23:34:27 +01:00

196 lines
5.4 KiB
JSON

{
"name": "@bitbaum/accountkit",
"version": "0.25.0",
"description": "One account for every bitbaum product: the account menu, accounts themselves (better-auth: password, magic link, passkeys, 2FA, OIDC) and Sign in with OrangeCat. Styled from @bitbaum/design-tokens.",
"license": "MIT",
"author": "Cato",
"homepage": "https://github.com/bitbaum/accountkit#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/bitbaum/accountkit.git"
},
"bugs": {
"url": "https://github.com/bitbaum/accountkit/issues"
},
"keywords": [
"account-menu",
"avatar",
"sign-out",
"react",
"headless-auth",
"orangecat",
"oidc",
"next-auth",
"auth.js"
],
"type": "module",
"sideEffects": [
"*.css"
],
"packageManager": "pnpm@11.25.0",
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"files": [
"dist",
"styles.css"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./orangecat": {
"types": "./dist/orangecat.d.ts",
"default": "./dist/orangecat.js"
},
"./styles.css": "./styles.css",
"./auth": {
"types": "./dist/auth/index.d.ts",
"default": "./dist/auth/index.js"
},
"./auth/password": {
"import": {
"types": "./dist/auth/password.d.ts",
"default": "./dist/auth/password.js"
},
"require": {
"types": "./dist/auth/password.d.cts",
"default": "./dist/auth/password.cjs"
}
},
"./auth/schema": {
"types": "./dist/auth/schema.d.ts",
"default": "./dist/auth/schema.js"
},
"./auth/server": {
"types": "./dist/auth/server.d.ts",
"default": "./dist/auth/server.js"
},
"./auth/next": {
"types": "./dist/auth/next.d.ts",
"default": "./dist/auth/next.js"
},
"./auth/nextauth-compat": {
"types": "./dist/auth/nextauth-compat.d.ts",
"default": "./dist/auth/nextauth-compat.js"
},
"./auth/switch": {
"types": "./dist/auth/switch.d.ts",
"default": "./dist/auth/switch.js"
},
"./auth/compat-testing": {
"types": "./dist/auth/compat-testing.d.ts",
"default": "./dist/auth/compat-testing.js"
},
"./auth/import-rehearsal": {
"types": "./dist/auth/import-rehearsal.d.ts",
"default": "./dist/auth/import-rehearsal.js"
},
"./auth/client": {
"types": "./dist/auth/client.d.ts",
"default": "./dist/auth/client.js"
},
"./auth/react": {
"types": "./dist/auth/react.d.ts",
"default": "./dist/auth/react.js"
},
"./auth/hash": {
"import": {
"types": "./dist/auth/hash.d.ts",
"default": "./dist/auth/hash.js"
},
"require": {
"types": "./dist/auth/hash.d.cts",
"default": "./dist/auth/hash.cjs"
}
},
"./auth/password-field": {
"types": "./dist/auth/password-field.d.ts",
"default": "./dist/auth/password-field.js"
},
"./auth/mail": {
"types": "./dist/auth/mail.d.ts",
"default": "./dist/auth/mail.js"
}
},
"peerDependencies": {
"@better-auth/passkey": "^1.7.10",
"@bitbaum/mail-kit": "^0.2.0",
"better-auth": "^1.7.10",
"drizzle-orm": "^0.45.4",
"next": "^16.4.0",
"react": ">=18"
},
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.json && node scripts/build-cjs.mjs",
"lint": "eslint .",
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.types.json",
"test": "node --test test/*.test.js",
"check:dist": "git diff --exit-code --stat -- dist",
"verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm test && pnpm run test:browser",
"format": "prettier --write .",
"format:check": "prettier --check .",
"demo": "esbuild demo/demo.tsx --bundle --jsx=automatic --format=iife --define:process.env.NODE_ENV='\"production\"' --outfile=demo/dist/demo.js --log-level=warning",
"test:browser": "pnpm run demo && node test/browser.mjs"
},
"devDependencies": {
"@auth/core": "0.41.3",
"@better-auth/passkey": "^1.7.10",
"@bitbaum/design-tokens": "github:bitbaum/design-tokens#8b82accab3775f3e18ed2fc61de41ba2127afae7",
"@bitbaum/mail-kit": "0.2.0",
"@electric-sql/pglite": "^0.5.10",
"@eslint/js": "^10.0.1",
"@types/node": "^26.4.0",
"@types/pg": "^8.23.1",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.3",
"bcryptjs": "^3.0.3",
"better-auth": "^1.7.10",
"drizzle-kit": "^0.31.11",
"drizzle-orm": "^0.45.4",
"esbuild": "^0.28.2",
"eslint": "^10.9.1",
"globals": "^17.11.0",
"next": "16.4.3",
"pg": "^8.23.1",
"playwright": "1.64.1",
"prettier": "^3.9.6",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"typescript": "^6.0.3",
"typescript-eslint": "^8.68.0"
},
"peerDependenciesMeta": {
"better-auth": {
"optional": true
},
"@better-auth/passkey": {
"optional": true
},
"drizzle-orm": {
"optional": true
},
"next": {
"optional": true
},
"@bitbaum/mail-kit": {
"optional": true
}
},
"dependencies": {
"@noble/curves": "^2.4.0",
"@scure/base": "^2.4.0",
"limitkit": "^0.2.1",
"uqr": "^0.1.3",
"zod": "^4.6.7"
},
"bin": {
"accountkit-rehearse-import": "./dist/bin/rehearse-import.js"
}
}