Open source · TypeScript · MIT

Auth that lives in your app.

Sign-in, sessions, organizations and agent access as a TypeScript library. It runs on your server and keeps every record in your database.

npm install @entro314labs/entro-auth
/api/auth · example logLive
16:02:01.000infoPOST /sign-in/email 200 · 41 ms
16:02:01.000warntwo-factor required · redirect held for /two-factor
16:02:09.000infoPOST /two-factor/verify-totp 200 · 18 ms
16:02:09.000debugset-cookie entro-auth.session_token · HttpOnly · SameSite=Lax
16:02:09.000infosession created · expires in 7 d
16:02:22.000errorPOST /sign-in/email 401 · INVALID_EMAIL_OR_PASSWORD
16:02:23.000warnrate limit · 4 of 10 for /sign-in/email
16:02:31.000infoPOST /passkey/verify-authentication 200 · 64 ms
16:02:31.000infosession renewed · token rotated, id kept
16:02:40.000infoPOST /organization/invite-member 200 · 33 ms

10 lines · following

What’s in the box

try each one, it works

What’s in the box

01Sign in/passkey/* · /two-factor/*

Passkeys first, passwords when you want them.

Sign in to Acme

Enter your email and we will send you a 6 digit code.

or
No account?
02Organizations/organization/*

Roles you define in code, enforced on every route.

Organization roles

Organization roles: capabilities by role
CapabilityOwnerAdminMember
Members
Invite members
Remove members
Organization
Manage billing
Delete organization
GrantedInherited
03Agents/agent/*

Agents act for a user, within what they approved.

  • I need to read this user’s invoices, so I ask for that capability first.

  • Requested, doneinvoices:read120 ms
  • User approved, donefor 1 hour4.2 s
  • Called, doneGET /invoices86 ms
  • Refused, failedinvoices:delete

    Not granted to this agent

04CLI@entro314labs/entro-auth-cli

One command writes the tables your plugins need.

my-app
~/my-app npx @entro314labs/entro-auth-cli@latest generate
preparing schema...
✔ Do you want to generate the schema to ./auth-schema.ts? … yes
Schema was generated successfully!

And the rest of the ledger

All plugins
  1. 05magicLink()Sign-in links by email
  2. 06emailOTP()One-time codes for sign-in and verification
  3. 07sso()SAML and OIDC single sign-on per organization
  4. 08oauthProvider()Run your own OAuth and OpenID Connect provider
  5. 09apiKey()Keys with permissions, rate limits and expiry
  6. 10mcp()Authorization for MCP servers
  7. 11admin()Users, bans and impersonation
  8. 12captcha()Turnstile, reCAPTCHA, hCaptcha or CaptchaFox on chosen routes
  9. 13phoneNumber()Sign-in and verification by SMS
  10. 14multiSession()Several accounts in one browser
  11. 15jwt()Signed tokens and a JWKS endpoint
  12. 16waitlist()Invite-only sign-up with a queue

Watch it from a dashboard

About Infrastructure

Entro Auth Infrastructure is a hosted dashboard for the same records: users, sessions, organizations, sign-in activity and audit logs. It is in development; this preview uses sample data.

dash.auth.entro314.com · preview with sample dataIn development
Sign-ins today+3.0%
1,284

vs 1,246 yesterday

Active users+12
312

in the last 24 hours

Blocked attempts−5
17

rate limit and captcha

Sign-ins, last 14 days1,284+58% in 14 days
Recent users
Arjun Raoarjun@acme.devEmail code13 h ago
Jonas Weberjonas@acme.devPassword + TOTP114 min ago
Lea Martinlea@acme.devGitHub21 h ago
Maya Okaformaya@acme.devPasskey32 min ago
Sofia Costasofia@acme.devPasskey4Yesterday

Start

From an empty app to signed-in users.