{"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,"search_vec":"'1.1.0':39 '1.5.0':34 '14':75 '180':72 '2.1':14,60 '20':36 'ad':11 'app':53 'app-password':52 'atcute/oauth-node-client':17 'atproto':81 'atproto/bluesky':12 'auth':3,8,33,85 'authent':15,82 'base':66 'better':2,7,32,84 'better-auth':6,31,83 'better-auth-bski':1 'blueski':86 'bski':4 'bun':38 'bundl':48 'client':29 'confidenti':28,67 'day':73,76 'differenti':50 'dpop':19,87 'flow':55 'footprint':46 'implement':57 'instal':45 'javascript':80 'keypair':65 'keypair-bas':64 'longer':70 'mode':68,79 'node.js':35 'oauth':13,59,88 'oauth2':89 'option':63 'par':20,90 'password':54 'pkce':21 'plugin':9 'public':26,78 'reduc':44 'requir':30 'run':23 'session':71 'ship':40 'standard':61 'support':18 'type':42 'typescript':41,91 'v0.1.9':10 'valibot':49 'via':16 'vs':74","created_at":"2026-05-01T13:42:28.518729+00:00","updated_at":"2026-05-01T13:42:28.518729+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/nperez0111/better-auth-bsky","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/better-auth-bsky","openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","type-stubs"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}