Registry / auth-security / better-auth-steam

better-auth-steam

JSON →
library0.1.1jsnpmunverified

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-steam
INSTALL
IMPORT
SIG · BETTER-AUTH-STEAM
B
better-auth-steam
auth-securityjavascriptv0.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

steamOpenID
import { steamOpenID } from 'better-auth-steam'
const steamOpenID = require('better-auth-steam')
ESM-only import. CommonJS require() will fail.
steamOpenIDClient
import { steamOpenIDClient } from 'better-auth-steam/client'
import { steamOpenIDClient } from 'better-auth-steam'
Client plugin is exported from the /client subpath, not the main entry.
SteamPluginOptions
import type { SteamPluginOptions } from 'better-auth-steam'
import { SteamPluginOptions } from 'better-auth-steam'
Type-only import. Options interface is not a runtime value.

Server-side setup: imports Better Auth minimal client and steamOpenID plugin, configures with a Steam API key from environment variable.

import { betterAuth } from 'better-auth/minimal'; import { steamOpenID } from 'better-auth-steam'; export const auth = betterAuth({ plugins: [ steamOpenID({ apiKey: process.env.STEAM_API_KEY ?? '' }) ] });
Debug
Known issues
gotchaMissing or empty STEAM_API_KEY environment variable will cause runtime errors during Steam profile fetch.
fix
Ensure STEAM_API_KEY is set in production and development environments. Validate with zod or a runtime check.
affects: >=0.1.0
deprecatedSince version 0.1.0, the plugin does not support custom callback base URL configuration. Redirects are bound to the current origin.
fix
If you need a custom callback URL, consider forking the plugin or using a reverse proxy.
affects: >=0.1.0
breakingThe plugin requires Better Auth >= 1.4.0. Using an older version will cause import or runtime errors.
fix
Upgrade Better Auth to version 1.4.0 or later.
affects: <1.4.0
gotchaThe synthetic email domain defaults to 'steam.local' which may conflict with local development email setups.
fix
Override the syntheticEmailDomain option to a domain you control, or handle synthetic emails in your email verification flow.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'better-auth-steam'
Package not installed via pnpm/npm/yarn.
fix
Run 'pnpm add better-auth-steam' (or npm install / yarn add).
TypeError: Cannot destructure property 'apiKey' of 'undefined' or 'null'
Missing or undefined STEAM_API_KEY environment variable.
fix
Set the STEAM_API_KEY environment variable in your .env file or shell.
Error: better-auth requires zod >= 4. Found zod 3.x.x.
Incompatible zod version installed.
fix
Install zod >= 4: 'pnpm add zod@^4'
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
better-authrequiredpeer dependency: plugin integration requires Better Auth >= 1.4.0
zodrequiredpeer dependency: used for runtime schema validation (zod >= 4)
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
better-auth-steam — npm install better-auth-steam · libregistry