Screepsmod-auth is a mod for the Screeps private server that adds user/password authentication, enabling login via the API and web form. Version 2.8.2 is current, with low release cadence. It supports password setting via Steam client, server CLI, and GitHub OAuth. Configurable initial CPU and spawn blocking. Differentiates from default Steam-only auth by allowing custom credentials and GitHub login.
npm install screepsmod-authVerified import paths — ran on the pinned version, not inferred.
Shows basic usage: set a password via CLI, and configure custom authUser function.
Use named imports: import { setPassword, authUser, config } from 'screepsmod-auth'Use ES module imports: import { ... } from 'screepsmod-auth'Open Steam client once to create initial account before setting password via web.
Set callback URL to /api/auth/github/return on your server, e.g., https://screeps.mydomain.com/api/auth/github/return
Use environment variables GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, etc.
Run 'npm install screepsmod-auth' in your server folder
Use 'import { setPassword } from 'screepsmod-auth''Ensure callback URL ends with '/api/auth/github/return' and matches exactly
Set 'preventSpawning = false' in [auth] config or whitelist user