{"id":18134,"library":"auth-mini","title":"Auth Mini","description":"Minimal, opinionated authentication server (v0.2.0) for apps needing a solid auth core without external dependencies. Supports password-less sign-in via email OTP, WebAuthn passkeys, and Ed25519 keys. Uses SQLite for storage, issues JWT access tokens with opaque refresh tokens, and provides JWKS endpoints for key rotation. Released infrequently as a pre-1.0 project. Differentiates from Auth0/Firebase by being self-hosted with no external database servers required.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/zccz14/auth-mini","tags":["javascript"],"install":[{"cmd":"npm install auth-mini","lang":"bash","label":"npm"},{"cmd":"yarn add auth-mini","lang":"bash","label":"yarn"},{"cmd":"pnpm add auth-mini","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Requires Node >=20.10.0 for built-in features","package":"node","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require not supported. Use dynamic import if needed.","wrong":"const { AuthMini } = require('auth-mini')","symbol":"AuthMini","correct":"import { AuthMini } from 'auth-mini'"},{"note":"Default export for quick setup. Requires ESM environment.","wrong":"const authMin = require('auth-mini')","symbol":"authMin","correct":"import authMin from 'auth-mini'"},{"note":"TypeScript type for authenticator instances. If using JS, omit.","wrong":"","symbol":"Authenticator","correct":"import { Authenticator } from 'auth-mini'"}],"quickstart":{"code":"import authMin from 'auth-mini';\n\nconst server = authMin({\n  port: 3000,\n  database: 'file:./auth.db',\n  secrets: {\n    jwtSecret: process.env.JWT_SECRET ?? 'change-me',\n    sessionSecret: process.env.SESSION_SECRET ?? 'change-me'\n  },\n  email: {\n    from: 'noreply@example.com',\n    transport: {\n      host: 'smtp.example.com',\n      port: 587,\n      auth: {\n        user: process.env.SMTP_USER ?? '',\n        pass: process.env.SMTP_PASS ?? ''\n      }\n    }\n  },\n  cors: {\n    origin: 'https://myapp.com'\n  }\n});\n\nserver.start().then(() => {\n  console.log('Auth Mini running on port 3000');\n});","lang":"typescript","description":"Shows how to create and start an Auth Mini server with email transport, CORS configuration, and required secrets."},"warnings":[{"fix":"Upgrade Node.js to v20.10.0 or later.","message":"Requires Node.js >=20.10.0; older versions will throw syntax errors.","severity":"breaking","affected_versions":"<20.10.0"},{"fix":"Use import syntax or dynamic import() in CommonJS files.","message":"ESM-only package; CommonJS require() will not work.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Use import { AuthMini } from 'auth-mini'; instead of default import.","message":"Default export will be removed in v1.0.0 in favor of named exports.","severity":"deprecated","affected_versions":">=0.1.0 <1.0.0"},{"fix":"Set database to 'file:./auth.db' or similar absolute 'file:' URI.","message":"Database path must use file: prefix for SQLite; relative paths without file: will fail.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Provide a JWT secret of at least 32 characters.","message":"JWT secret must be at least 32 characters long; shorter secrets cause runtime error.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Provide two distinct secrets for session and JWT.","message":"Session secret and JWT secret must be different; using same value will throw.","severity":"breaking","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import statement or dynamic import() instead of require().","cause":"CommonJS require() used with ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Ensure you imported correctly: const server = authMin(options); await server.start();","cause":"Trying to call .start() on the default export object without wrapping.","error":"TypeError: Cannot read properties of undefined (reading 'start')"},{"fix":"Provide a secret string of 32 or more characters.","cause":"JWT or session secret is too short.","error":"Error: secret must be at least 32 characters long"},{"fix":"Set database to 'file:./auth.db' (with file: prefix) and ensure directory exists.","cause":"Database path missing 'file:' prefix or directory not writable.","error":"Error: open ./auth.db: unable to open database file"},{"fix":"Set cors.origin to a string URL or array of strings.","cause":"CORS origin provided as non-string value (e.g., undefined or object).","error":"Error: CORS origin must be a string or array"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}