{"library":"pico-auth","title":"Pico Auth","description":"A minimal authentication library (v0.0.43, alpha) providing user/password login, TOTP-based MFA, and impersonation support. Focuses on simplicity and flexibility by letting callers supply custom UserProvider and ImpersonateProvider interfaces. Ships TypeScript types and offers JWT token issuance with refresh tokens. Active development with frequent updates.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install pico-auth"],"cli":null},"imports":["import { authenticate } from 'pico-auth'","import { refreshToken } from 'pico-auth'","import { UserProvider } from 'pico-auth'","import { mfaRegister } from 'pico-auth'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { authenticate } from 'pico-auth';\n\nconst userProvider = {\n  async getUser(login: string) {\n    // mock: return user from DB\n    return { id: 'user1', passwordHash: 'hashed_pw', name: 'Test User' };\n  },\n  async putUser(user: any) { return user; },\n  userPasswordPath: 'passwordHash',\n};\n\nconst jwtSpecs = {\n  secretKey: process.env.JWT_SECRET || 'changeme',\n  expiryTimeMs: 3600000, // 1 hour\n};\n\nasync function main() {\n  const tokens = await authenticate('user1', 'password123', undefined, undefined, userProvider, undefined, jwtSpecs);\n  console.log('Access token:', tokens.token);\n  console.log('Refresh token:', tokens.refreshToken);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Demonstrates basic password authentication with custom UserProvider and JWT spec, outputting access and refresh tokens.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}