Steam OpenID 2.0 plugin for Better Auth, providing Steam login via two endpoints: GET /api/auth/steam/login and GET /api/auth/steam/callback. It adds a nullable unique steamId field on the user model and requires better-auth >= 1.4.0 and zod >= 4 as peer dependencies. Version 0.1.1 ships TypeScript types. Key differentiators: full Steam OpenID assertion validation using check_authentication, synthetic email generation for users without email, and customizable profile mapping.
npm install better-auth-steamVerified import paths — ran on the pinned version, not inferred.
Server-side setup: imports Better Auth minimal client and steamOpenID plugin, configures with a Steam API key from environment variable.
Ensure STEAM_API_KEY is set in production and development environments. Validate with zod or a runtime check.
If you need a custom callback URL, consider forking the plugin or using a reverse proxy.
Upgrade Better Auth to version 1.4.0 or later.
Override the syntheticEmailDomain option to a domain you control, or handle synthetic emails in your email verification flow.
Run 'pnpm add better-auth-steam' (or npm install / yarn add).
Set the STEAM_API_KEY environment variable in your .env file or shell.
Install zod >= 4: 'pnpm add zod@^4'