Skip to content

API reference

Generated from the source by TypeDoc, so it always matches the published types. Each entry point is a separate import; its optional peer dependencies are listed in its description and on Entry points.

Import Exports Description
@xtandard/kit 1 @xtandard/kit — the shared building blocks of the xtandard products.
@xtandard/kit/storage 33 @xtandard/kit/storage — the neutral key/value storage contract (KvStorage and its optional watch / compareAndSwap capabilities) with its feature-detection guards, withWatch + pgListenNotify for composable change notifications, the escaping and canonical-JSON helpers the drivers share, and generic key-segment helpers.
@xtandard/kit/storage/memory 4 @xtandard/kit/storage/memory — in-memory storage (zero deps; tests, dev, single-process apps), watchable and compare-and-swap capable, with an onWrite hook for product indexes.
@xtandard/kit/storage/file 8 @xtandard/kit/storage/file — file-system storage: one JSON file per key under a base directory, case-safe segment encoding, write-then-rename, fs.watch change events, in-process compare-and-swap, and read paths and a migration for stores in the legacy unencoded layout.
@xtandard/kit/storage/sqlite 3 @xtandard/kit/storage/sqlite — SQLite storage on bun:sqlite (Bun only, zero npm deps), with single-statement compare-and-swap.
@xtandard/kit/storage/sqlite/internals 3 @xtandard/kit/storage/sqlite/internals — semi-public building blocks of the bun:sqlite driver (ADR 0004), for product capability layers (e.g.
@xtandard/kit/storage/libsql 3 @xtandard/kit/storage/libsql — libSQL / Turso storage over @libsql/client (remote, embedded replica or local file), with single-statement compare-and-swap.
@xtandard/kit/storage/libsql/internals 9 @xtandard/kit/storage/libsql/internals — semi-public building blocks of the libSQL driver (ADR 0004): the lazy connection with one-time, retried DDL (libsqlConnection, also the ready plumbing for product tables such as au’s event log), the executor adapter and the shared SQLite KV core.
@xtandard/kit/storage/postgres 3 @xtandard/kit/storage/postgres — Postgres storage: one jsonb key/value table over pg or PGlite, created on first use, with single-statement compare-and-swap.
@xtandard/kit/storage/postgres/internals 7 @xtandard/kit/storage/postgres/internals — semi-public building blocks of the Postgres driver (ADR 0004): the lazy pg connection, pgReady (one-time, retried DDL; au’s event log adds its tables here) and the KV operations over an existing table.
@xtandard/kit/storage/mongodb 3 @xtandard/kit/storage/mongodb — MongoDB storage: one { _id: key, value } collection over the mongodb driver, with single-update compare-and-swap that also swaps documents written before canonicalisation.
@xtandard/kit/storage/mongodb/internals 5 @xtandard/kit/storage/mongodb/internals — semi-public building blocks of the MongoDB driver (ADR 0004): the lazy connection, the duplicate-key check and the KV operations over a collection.
@xtandard/kit/storage/redis 6 @xtandard/kit/storage/redis — Redis storage: createRedisStorage() (JSON strings) and createRedisJSONStorage() (RedisJSON documents) over node-redis, with an atomic Lua compare-and-swap, keyspace-notification watch and an onWrite hook.
@xtandard/kit/storage/redis/internals 9 @xtandard/kit/storage/redis/internals — semi-public building blocks of the Redis drivers (ADR 0004): the lazy connection, de-duplicating scanKeys, the value codecs and createRedisKvStorage (the driver with an explicit codec and a shared connection), so a product capability layer such as wh’s claimDue runs on the same client.
@xtandard/kit/storage/cloudflare-kv 4 @xtandard/kit/storage/cloudflare-kv — Cloudflare Workers KV storage over a KVNamespace binding (no npm dependency; eventually consistent, no compare-and-swap).
@xtandard/kit/storage/unstorage 3 @xtandard/kit/storage/unstorage — wrap any unstorage Storage (any driver) as a KvStorage, with lossless key encoding and read-through to legacy keys.
@xtandard/kit/storage/drizzle 4 @xtandard/kit/storage/drizzle — storage over a Drizzle table and database you own (Postgres, MySQL or SQLite): no DDL, no connection of its own, single-statement compare-and-swap.
@xtandard/kit/storage/drizzle/internals 8 @xtandard/kit/storage/drizzle/internals — semi-public helpers of the Drizzle driver (ADR 0004): dialect detection, MySQL affected-row counting and prefix ranges, the lazily imported sql tag and the structural database type.
@xtandard/kit/storage/testing 21 @xtandard/kit/storage/testing — the shared storage conformance suite.
@xtandard/kit/drizzle/pg 4 @xtandard/kit/drizzle/pg — the Postgres KV table factory pgKvTable(name, opts) and the textC (text COLLATE "C") column helper.
@xtandard/kit/drizzle/mysql 6 @xtandard/kit/drizzle/mysql — the MySQL KV table factory mysqlKvTable(name, opts) and the binVarchar (utf8mb4_bin) column helper.
@xtandard/kit/drizzle/sqlite 3 @xtandard/kit/drizzle/sqlite — the SQLite KV table factory sqliteKvTable(name, opts).
@xtandard/kit/auth 2 @xtandard/kit/auth — the authentication contract: Principal and AuthProvider.
@xtandard/kit/auth/none 2 @xtandard/kit/auth/none — noAuth(): every request is the anonymous principal.
@xtandard/kit/auth/basic 5 @xtandard/kit/auth/basic — HTTP Basic authentication with scrypt password hashes (hashPassword / verifyPassword).
@xtandard/kit/auth/delegated 2 @xtandard/kit/auth/delegated — build an auth provider from plain functions (JWT, sessions, API keys, an existing middleware).
@xtandard/kit/authorization 5 @xtandard/kit/authorization — the authorization contract, generic over a product’s action and resource unions, and defineActions to build a product’s action constants.
@xtandard/kit/authorization/none 1 @xtandard/kit/authorization/none — noAuthorization(): every action is allowed.
@xtandard/kit/authorization/roles 3 @xtandard/kit/authorization/roles — role-based authorization: a role → actions policy (the product passes its DEFAULT_ROLE_POLICY) plus a readonly switch.
@xtandard/kit/authorization/delegated 2 @xtandard/kit/authorization/delegated — build an authorization provider from a plain decision function (ABAC, OPA, Cedar, ownership checks).
@xtandard/kit/hooks 12 @xtandard/kit/hooks — the hooks runner: before hooks run sequentially and may deny with HookDeniedError, after hooks run concurrently with isolated errors.
@xtandard/kit/hooks/log 2 @xtandard/kit/hooks/log — a reference hook that logs mutation events, as text or one JSON object per line.
@xtandard/kit/server 36 @xtandard/kit/server — the HTTP side of a panel: createPanelHandler (healthcheck, API, OpenAPI, static UI, SPA fallback, CORS, close()), the index.html renderer, base-path and CORS helpers, and the plumbing for product API routers (json, error, match, intParam, mapError, authenticate with the scoped-token short-circuit, authorize).
@xtandard/kit/server/router 16 @xtandard/kit/server/router — the optional declarative router: one route table drives dispatch, auth, authorization, readonly, 405 + Allow, body validation and the generated OpenAPI 3.1 document.
@xtandard/kit/tokens 7 @xtandard/kit/tokens — scoped HMAC tokens (the products’ portal and viewer tokens): <prefix><payload>.<signature>, WebCrypto only, with secret rotation.
@xtandard/kit/adapters/bun 2 @xtandard/kit/adapters/bun — pass a panel to Bun.serve (a passthrough: Bun serves web-standard handlers natively).
@xtandard/kit/adapters/node 9 @xtandard/kit/adapters/node — the Fetch ↔ Node bridge shared by Express and the CLI: appended multi-value headers, re-serialised pre-parsed bodies, every Set-Cookie kept, response bodies streamed with backpressure and cancelled on disconnect.
@xtandard/kit/adapters/express 3 @xtandard/kit/adapters/express — serve a panel from Express through the shared Node bridge (no runtime express import).
@xtandard/kit/adapters/hono 6 @xtandard/kit/adapters/hono — mount a panel on a Hono app, and read waitUntil safely on every runtime (no runtime hono import).
@xtandard/kit/adapters/elysia 4 @xtandard/kit/adapters/elysia — createPass for Elysia 1.x and 2.x: rebuild the request Elysia already parsed (POST/PUT/PATCH/DELETE, stale content-length dropped, strings passed through), a raw handler for parse: "none" routes, and plugin options with seed: prefix for multi-mount.
@xtandard/kit/adapters/next 3 @xtandard/kit/adapters/next — toNextHandler(panel): the method exports of a Next.js App Router catch-all route.
@xtandard/kit/cli 31 @xtandard/kit/cli — building blocks for the products’ CLIs: env (empty counts as unset), parseArgs, buildAuthFromEnv and storageFromEnv (both reject unknown modes/drivers), describeStorage, startServer (Bun or the Node bridge), serve, pkgVersion and the isMainModule self-run guard.
@xtandard/kit/util 15 @xtandard/kit/util — small shared utilities: durations, id generators (the products’ three persisted formats), the validation core, canonical JSON and the JSON / Actor types.
@xtandard/kit/util/core 10 @xtandard/kit/util/core — the dependency-free part of @xtandard/kit/util: durations, id generators, canonical JSON and the JSON / Actor types.
@xtandard/kit/testing 5 @xtandard/kit/testing — generic test helpers: createTestClock and collectingSink.
@xtandard/kit/ui 97 @xtandard/kit/ui — the shared admin shell of the xtandard products, as compiled React components and helpers (ADR 0008): - primitives (ToggleSwitch, Segmented, Dropdown, CreatableCombobox, TextInput, TextArea), Button/Badge/Avatar/Kbd, toasts and the theme toggle; - the theme store (createThemeStore, keyed per product), host-theme detection and ThemeProvider/useTheme; - createApiClient (the panel API client core) and takeTokenFromUrl; - bootSpa (the SPA’s main.tsx), ShellFrame + useShellConfig + useShellNav; - the common bits (Spinner, PageHeader, ModalDialog, Drawer, CopyButton, …), the format helpers and BrandMark.
@xtandard/kit/ui/embed 9 @xtandard/kit/ui/embed — createEmbed({ App, scopeClass, api, themeKey }) builds a product’s React embed (Dashboard + the token-scoped TokenEmbed) on the shared plumbing: synchronous API base, one theme per embed on the scoped wrapper, portals inside the wrapper, hash / browser / memory routing (the memory router keeps its query string), and query invalidation when the token changes.
@xtandard/kit/build 42 @xtandard/kit/build — build tooling shared by the xtandard products (also behind the xtandard-kit bin): - scopeCss / findUnscopedLeaks / scopeCssFile: scope the React-embed stylesheet under the wrapper class (xtandard-kit scope-embed-css); - fixElysia2Types: rewrite the elysia-v2 alias in the Elysia 2 declarations; - apiSurface / diffApiSurface: API-surface snapshots and the no-removals gate (ADR 0003); - defineXtandardConfig, defineUiConfig, defineEmbedConfig, definePlaywrightConfig; - createExampleRunner (the scripts/example.ts runner); - runEmbedCssSuite / runEmbedThemeE2e: reusable test suites, test API injected.
@xtandard/kit/site 38 @xtandard/kit/site — the docs-site tooling shared by the xtandard products (Astro Starlight over the repository’s Markdown, plus a TypeDoc API reference): - defineSiteManifest: the information architecture (pages, sidebar, pending guides) and apiEntries() (one module per exports entry); - syncSite / runSync: the pre-build step that writes site/src/content/docs/; - defineXtandardSite: the Astro config (Starlight, starlight-typedoc, Mermaid, links validator, head tags); - createTypedocPlugin and apiOverviews: the API reference’s named return types, re-export lists and overview pages.