@athas/shared-api
external-readyShared auth and oRPC client utilities for first-party frontends.
What it provides
- Better Auth client factory (
createAthasAuthClient) - oRPC client factory (
createAthasOrpcClient) - shared auth/session integration utilities
Where it fits now
@athas/shared-api is the frontend composition layer that wires multiple core packages for app bootstrap:
@athas/auth-corefor AuthN/AuthZ-facing types and capability checks@athas/telemetry-corefor provider-agnostic telemetry routing- contract-typed transport via
@athas/contracts
Boundary direction
Keep shared-api focused on frontend composition and adapters, while domain/runtime logic moves into dedicated cores.
Examples:
- auth/session domain rules ->
@athas/auth-core - telemetry routing rules ->
@athas/telemetry-core - notification/integration runtime contracts -> dedicated core packages
Contract typing model
- Uses
AthasOrpcContractfrom@athas/contracts. - Uses
ContractRouterClientfor strongly typed client calls.
This keeps frontend transport calls aligned with backend contract namespaces (public, client, admin).
Usage pattern
- App bootstrap wiring lives in
apps/*/src/lib/api.ts. - Feature modules call oRPC through
features/*/api.ts. - Routes/screens consume feature hooks, not transport clients directly.