Registry / auth-security / screepsmod-auth

screepsmod-auth

JSON →
library2.8.2jsnpmunverified

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-auth
INSTALL
IMPORT
SIG · SCREEPSMOD-AUTH
S
screepsmod-auth
auth-securityjavascriptv2.8.2
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.

authUser
import { authUser } from 'screepsmod-auth'
import authUser from 'screepsmod-auth'
authUser is a named export, not default. Used in config.auth.authUser.
setPassword
import { setPassword } from 'screepsmod-auth'
const setPassword = require('screepsmod-auth').setPassword
ESM import; CommonJS require pattern still works but ESM is preferred.
config
import { config } from 'screepsmod-auth'
import { default as config } from 'screepsmod-auth'
config is a named export, not default.

Shows basic usage: set a password via CLI, and configure custom authUser function.

import { setPassword } from 'screepsmod-auth'; // Via CLI: npx screeps cli // Then run: setPassword('Username', 'YourDesiredPassword') // Or in server config: import { config } from 'screepsmod-auth'; config.auth.authUser = async (username, password) => { // custom auth logic return username === 'admin' && password === 'secret' ? { username } : false; };
Debug
Known issues
breakingRemoved default export in v2; only named exports available.
fix
Use named imports: import { setPassword, authUser, config } from 'screepsmod-auth'
affects: >=2.0.0
deprecatedCommonJS require() still works but ESM is recommended for future compatibility.
fix
Use ES module imports: import { ... } from 'screepsmod-auth'
affects: >=2.0.0
gotchaPasswords set via web form require Steam client initial account creation first.
fix
Open Steam client once to create initial account before setting password via web.
affects: >=0.0.0
gotchaGitHub OAuth callback URL must exactly match the registered callback on GitHub.
fix
Set callback URL to /api/auth/github/return on your server, e.g., https://screeps.mydomain.com/api/auth/github/return
affects: >=0.0.0
deprecatedThe .screepsrc ini config is deprecated in favor of environment variables.
fix
Use environment variables GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, etc.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'screepsmod-auth'
Module not installed or wrong path
fix
Run 'npm install screepsmod-auth' in your server folder
TypeError: setPassword is not a function
Importing setPassword incorrectly (e.g., default import instead of named)
fix
Use 'import { setPassword } from 'screepsmod-auth''
Error: Github OAuth callback URL mismatch
Callback URL does not match GitHub app configuration
fix
Ensure callback URL ends with '/api/auth/github/return' and matches exactly
Error: spawn placement blocked
preventSpawning set to true in config and user not whitelisted
fix
Set 'preventSpawning = false' in [auth] config or whitelist user
Upgrade
Version history
2.8.2latest on npm
Audit
Dependencies
@screeps/backendrequiredPeer dependency required for mod integration with Screeps backend
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
screepsmod-auth — npm install screepsmod-auth · libregistry