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).
npm install better-auth-bskyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes server plugin with minimal config and demonstrates client-side sign-in flow.
Update better-auth to >=1.5.0.
Upgrade Node.js to >=20.
No code change needed. Upgrade to v0.1.7+ to benefit from smaller install.
Update tsdown config if building from source.
Provide a keyset via generateAtprotoKeypair() to enable confidential mode.
Ensure keyset is provided for local development with loopback.
Run 'bun add better-auth-bsky better-auth @atcute/oauth-node-client' (or npm/pnpm equivalent).
Ensure atprotoClient() is passed in the plugins array: createAuthClient({ plugins: [atprotoClient()] }).Use named import: import { atproto, generateAtprotoKeypair } from 'better-auth-bsky'.