Skip to content

TS packages design (historical)

This is the original design document that motivated splitting the TS side into auth-shared, auth-server-ts, and auth-server-nest. It lives in the auth platform repo as AUTH-TS-PACKAGES-DESIGN.md.

Useful when deciding how to add a new TS server consumer or when understanding why the package split looks the way it does.

Full text: AUTH-TS-PACKAGES-DESIGN.md in the auth-server repo.

Short version:

  • auth-shared is source-only types, deliberately. Every TS consumer has its own build step, so shipping pre-built artefacts would force a separate publish cadence. With source-only, a wire-shape change lands in one PR that updates every consumer through their normal type-check.
  • auth-server-ts is framework-agnostic so it can serve as the base for any future TS framework adapter (a hypothetical auth-server-fastify, auth-server-hono, etc.).
  • auth-server-nest is the first adapter. The pattern (module + guards + decorators wrapping the core) is the template for the next one.