{"id":24996,"library":"better-auth-bsky","title":"better-auth-bsky","description":"A better-auth plugin (v0.1.9) adding ATProto/Bluesky OAuth 2.1 authentication via @atcute/oauth-node-client. Supports DPoP, PAR, PKCE and runs as a public or confidential client. Requires better-auth >=1.5.0, Node.js >=20 or Bun >=1.1.0. Ships TypeScript types and reduces install footprint by bundling valibot. Differentiates from app-password flows by implementing the OAuth 2.1 standard, with optional keypair-based confidential mode for longer sessions (180 days vs 14 days for public mode).","status":"active","version":"0.1.9","language":"javascript","source_language":"en","source_url":"https://github.com/nperez0111/better-auth-bsky","tags":["javascript","atproto","authentication","better-auth","bluesky","dpop","oauth","oauth2","par","typescript"],"install":[{"cmd":"npm install better-auth-bsky","lang":"bash","label":"npm"},{"cmd":"yarn add better-auth-bsky","lang":"bash","label":"yarn"},{"cmd":"pnpm add better-auth-bsky","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin API required","package":"better-auth","optional":false},{"reason":"ATProto OAuth client implementation","package":"@atcute/oauth-node-client","optional":false}],"imports":[{"note":"Named export, not default.","wrong":"import atproto from 'better-auth-bsky'","symbol":"atproto","correct":"import { atproto } from 'better-auth-bsky'"},{"note":"Client plugin is in a separate subpath.","wrong":"import { atprotoClient } from 'better-auth-bsky'","symbol":"atprotoClient","correct":"import { atprotoClient } from 'better-auth-bsky/client'"},{"note":"ESM-only; require is unsupported.","wrong":"const generateAtprotoKeypair = require('better-auth-bsky')","symbol":"generateAtprotoKeypair","correct":"import { generateAtprotoKeypair } from 'better-auth-bsky'"}],"quickstart":{"code":"import { betterAuth } from 'better-auth';\nimport { atproto } from 'better-auth-bsky';\nimport { createAuthClient } from 'better-auth/client';\nimport { atprotoClient } from 'better-auth-bsky/client';\n\nexport const auth = betterAuth({\n  plugins: [\n    atproto({\n      clientName: 'My App',\n      clientUri: 'https://myapp.com',\n      keyset: [] // omit for public client\n    })\n  ]\n});\n\n// Client-side sign-in\nexport const client = createAuthClient({\n  plugins: [atprotoClient()]\n});\n\nasync function signIn() {\n  const { data, error } = await client.signIn.atproto({\n    handle: 'user.bsky.social',\n    callbackURL: '/dashboard'\n  });\n  if (!error) window.location.href = data.url;\n}","lang":"typescript","description":"Initializes server plugin with minimal config and demonstrates client-side sign-in flow."},"warnings":[{"fix":"Update better-auth to >=1.5.0.","message":"Peer dependency better-auth must be >=1.5.0; plugin will not work with older versions.","severity":"breaking","affected_versions":"<0.1.0"},{"fix":"Upgrade Node.js to >=20.","message":"Node.js version must be >=20.0.0 (uses modern features).","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"No code change needed. Upgrade to v0.1.7+ to benefit from smaller install.","message":"valibot was bundled as a dependency in v0.1.7; shipped inline to reduce install size.","severity":"deprecated","affected_versions":"<0.1.7"},{"fix":"Update tsdown config if building from source.","message":"The tsdown build tool dropped support for the 'external' option; v0.1.8+ uses 'deps.neverBundle' / 'deps.onlyBundle'.","severity":"deprecated","affected_versions":"<=0.1.7"},{"fix":"Provide a keyset via generateAtprotoKeypair() to enable confidential mode.","message":"Public client sessions are limited to 14 days; confidential sessions last 180 days.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure keyset is provided for local development with loopback.","message":"Loopback (localhost) is only supported in confidential mode during development.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'bun add better-auth-bsky better-auth @atcute/oauth-node-client' (or npm/pnpm equivalent).","cause":"Missing or incorrect installation of better-auth-bsky or its peer dependencies.","error":"Cannot find module 'better-auth-bsky' or its corresponding type declarations."},{"fix":"Ensure atprotoClient() is passed in the plugins array: createAuthClient({ plugins: [atprotoClient()] }).","cause":"Client-side atprotoClient() plugin not added to createAuthClient.","error":"Uncaught TypeError: client.signIn.atproto is not a function"},{"fix":"Use named import: import { atproto, generateAtprotoKeypair } from 'better-auth-bsky'.","cause":"Attempting to default-import a named-only export.","error":"SyntaxError: The requested module 'better-auth-bsky' does not provide an export named 'default'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}