Authworks logoAuthworksGitHub

Open source · MIT · Alpha

Identity infrastructure you actually own.

Authworks is an open-source (MIT) identity API with users, organizations, OIDC, MFA, passkeys and machine access — self-hosted as a single Bun service.

bun add @adaptive-ds/authworks
client.ts
import {​  projectApiClientCreate,​} from "@adaptive-ds/authworks/projects"​​const client = projectApiClientCreate({​  baseUrl: SERVER_URL,​  token: TOKEN,​})​await client.projectUserAssignmentCreate(REALM_ID, PROJECT_ID, {​  userId: USER_ID,​  roleKeys: ["reader"],​})​
OIDC + PKCE
Passkeys
TOTP
Multi-tenant orgs
Machine users
Audit log
Built with
Bun
Hono
Drizzle
SQLite

Features

One API for your whole identity layer

Users, organizations, protocols and machine access — all in one Bun/TypeScript package.

Users & sessions

Registration, login and sessions for your users, with verification and recovery built in.

  • Registration, login, verification and account deletion
  • Password change and recovery, Email OTP and WhatsApp OTP
  • Sessions with revocation, lockout and rate limiting
  • Google, GitHub and Microsoft sign-in

Organizations & realms

Multi-tenant structure with realms, organizations and fine-grained permissions.

  • Realms, organizations, memberships and invitations
  • Roles and permissions with tenant isolation
  • Per-organization branding and login/provider policy
  • Domain discovery and account linking

OIDC provider

Turn Authworks into the identity provider for your apps and services.

  • Client management and authorization code + PKCE
  • Access, ID and refresh tokens
  • Discovery, JWKS and UserInfo
  • Scopes, claims, consent, revocation and logout

MFA & passkeys

Stronger sign-in with phishing-resistant options and step-up checks.

  • TOTP and recovery codes
  • Passkeys via WebAuthn
  • Enforcement and step-up assurance
  • Security notifications and device/session management

Machine access

API keys and tokens for services, scripts and integrations.

  • Machine users and personal access tokens
  • Client credentials and API keys
  • Projects, applications, app roles and grants
  • Cross-org grants with fine-grained access evaluation

Admin & audit

Support tooling for operators, with every privileged action logged.

  • Impersonation with authorization limits
  • Audit events for every impersonation
  • Append-only event log that excludes secrets

Developers

Built for TypeScript teams

Everything a TypeScript team needs to integrate Authworks: typed clients, a scriptable CLI, and standard OIDC discovery.

client.ts
import {​  projectApiClientCreate,​} from "@adaptive-ds/authworks/projects"​​const client = projectApiClientCreate({​  baseUrl: SERVER_URL,​  token: TOKEN,​})​await client.projectUserAssignmentCreate(REALM_ID, PROJECT_ID, {​  userId: USER_ID,​  roleKeys: ["reader"],​})​
  • Typed API clients

    Call every endpoint with full TypeScript types, from user management to project assignments.

  • Public schema exports

    Reuse the same Valibot schemas and Drizzle models the server runs on.

  • CLI profiles

    Script every workflow from the terminal, with named profiles for local and hosted environments.

Security

Security controls included by default

Rate limiting, isolation, and audit trails are part of the platform, not add-ons.

  • Rate limiting and lockout

    Rate limiting and account lockout protect sign-in and recovery flows.

  • Step-up assurance

    Require stronger authentication before sensitive actions.

  • Tenant isolation

    Realms and organizations stay isolated, down to per-organization login and provider policy.

  • Secrets stay out of the log

    The append-only event log records what happened while excluding secrets.

  • Security notifications

    Users are notified about security-relevant changes to their accounts.

  • Impersonation with audit trail

    Admin impersonation runs under authorization limits and leaves audit events.

Self-host

One service. One SQLite file.

Authworks deploys as a single Bun service behind Caddy with a file-backed SQLite database. Your data never leaves your infrastructure.

  1. Your app

    Your product, wired up via OIDC

  2. Caddy

    Reverse proxy in front of the service

  3. Authworks (Bun)

    API, CLI, and OIDC provider in one service

  4. SQLite (WAL)

    File-backed database plus the append-only event log

Own your identity layer.

Open-source and self-hosted, with a typed TypeScript client and CLI included.

Found a problem? Report an issue