← Back to all posts

SDKs

Adaptive SDKs: one TypeScript core, thin adapters for any stack

11 min

How AuthKit TS becomes a portable core for browser auth flows — and how per-provider, per-language adapters keep that core useful from React to Go to PHP.

Most auth SDKs are written once per language and copy the same orchestration logic everywhere. We are inverting that: one TypeScript core for the browser, with thin adapters per provider and per language for everything else.

Browser side

  • authkit-ts core — the flow state machine: start, challenge, verify, complete, error.
  • Provider adapters — bind the core to a credential backend (Hanko first). The adapter knows the backend; the core does not.
  • Distribution — UMD bundle published as ui8kit.js next to AuthKit; npm package on npmjs.com/org/authfly.

Backend side

  • Go — first-class, since the IdP is Go. Reuses core contracts.
  • TypeScript / Node — server-side helpers for OIDC clients and session validation.
  • Python, PHP, .NET — thin SDKs over the same Management API and OIDC endpoints.

Adapter pattern

Every adapter implements three functions: turn user input into a credential challenge, verify the response, and surface a normalized identity to the caller. The orchestration loop stays in the core, so behaviour is identical across stacks.

Why this beats per-language rewrites

  • One bug-fix lands in one place.
  • Behaviour parity is testable by replaying the same flow against every adapter.
  • New providers ship as adapters, not as forks.

Auth Fly logo

Auth Fly

Open auth construction kit

About Auth Fly