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.

Import Exports Description
@xtandard/links 119 @xtandard/links — self-hosted, embeddable branded short links: a memory-first redirect plane, click analytics, conversion attribution and deep links over the storage you already run.
@xtandard/links/core 19 The links control plane: tenants, domains, links, slugs, bulk import, conversions, deferred deep links and the operator audit log — over any LinksStorage, with analytics through an AnalyticsSink.
@xtandard/links/schema 36 Core type definitions for @xtandard/links.
@xtandard/links/redirect 6 The redirect plane (ADR 0002, 0004): a web-standard handler that turns GET https://go.acme.com/{slug} into a redirect, records the click without waiting on the analytics sink, and serves deep-link association files, password and link-preview pages.
@xtandard/links/client 4 Browser helper for conversion attribution (ADR 0010) — the open equivalent of @dub/analytics’s click-id capture.
@xtandard/links/deeplinks 8 Deep links (ADR 0008): builders for the OS association files served from a short domain’s /.well-known/, Play Store install-referrer tagging, and the coarse fingerprint used for probabilistic deferred deep-link matching.
@xtandard/links/qr 6 QR codes for short links: renderQrSvg renders any text as a crisp, scalable SVG (one <path>, shape-rendering="crispEdges"), and qrUrl builds the URL a link’s QR code should encode — its short URL with ?qr=1, so scans are counted as qr: true clicks and the qr rule condition can route them.
@xtandard/links/import 15 Bulk import and export of links as CSV.
@xtandard/links/testing 8 Testing utilities — @xtandard/links/testing.
@xtandard/links/storage/memory 3 In-memory storage — zero dependencies; for tests, demos and development.
@xtandard/links/storage/file 3 File-system storage: createFileStorage() persists each key as a JSON file under a base directory.
@xtandard/links/storage/redis 4 Redis storage: createRedisStorage() (JSON strings) and createRedisJSONStorage() (RedisJSON documents) over node-redis, with Lua compare-and-swap and keyspace-notification watch.
@xtandard/links/storage/postgres 3 Postgres storage: createPostgresStorage() keeps a single jsonb key/value table, created on first use, with atomic compare-and-swap.
@xtandard/links/storage/drizzle 1 Drizzle storage: createDrizzleStorage() reads and writes a table you own (built with the drizzle/* factories) through the Drizzle database you pass.
@xtandard/links/storage/mongodb 3 MongoDB storage: createMongoStorage() over the mongodb driver, one collection of { _id: key, value } documents, with compare-and-swap.
@xtandard/links/storage/sqlite 3 SQLite storage on bun:sqlite: createSqliteStorage(), for single-node deployments and local persistence, with compare-and-swap.
@xtandard/links/storage/libsql 3 libSQL / Turso storage: createLibsqlStorage() over @libsql/client, for remote, replicated or embedded SQLite-dialect databases, with compare-and-swap.
@xtandard/links/drizzle/pg 2 Postgres Drizzle table factory for the links KV store: pgLinksTable() puts the table in your Drizzle schema and migrations.
@xtandard/links/drizzle/mysql 2 MySQL Drizzle table factory for the links KV store: mysqlLinksTable() puts the table in your Drizzle schema and migrations.
@xtandard/links/drizzle/sqlite 2 SQLite Drizzle table factory for the links KV store: sqliteLinksTable() puts the table in your Drizzle schema and migrations.
@xtandard/links/analytics/kv 6 The default analytics sink: time-bucket rollups in the links storage itself (zero extra infrastructure).
@xtandard/links/analytics/memory 4 In-memory analytics sink — zero dependencies; exact reference aggregation plus unique visitors.
@xtandard/links/analytics/clickhouse 5 ClickHouse analytics sink over the HTTP interface (fetch only, no peer dependencies): JSONEachRow inserts, parameter-bound queries, exact uniques, and the clickhouseSchema() DDL helper.
@xtandard/links/analytics/tinybird 5 Tinybird analytics sink (fetch only, no peer dependencies): Events API ingestion, SQL API queries, and the tinybirdDatasource() .datasource file helper.
@xtandard/links/analytics/analytics-engine 9 Cloudflare Workers Analytics Engine sink: writeDataPoint through the dataset binding, queries through the Analytics Engine SQL API with _sample_interval weighting.
@xtandard/links/auth/basic 2 HTTP Basic authentication for the panel: basicAuth() checks the Authorization: Basic header against a configured user list (scrypt password hashes via hashPassword, a custom verifier, or plaintext for development only).
@xtandard/links/authorization/none 1 No authorization: noAuthorization() allows every action.
@xtandard/links/authorization/roles 6 Role-based authorization: rolesAuthorization() maps role names to the actions they grant (built-in admin/editor/viewer policy by default), with a readonly switch that denies every mutating action.
@xtandard/links/authorization/delegated 2 Delegated authorization: delegatedAuthorization() wraps your own authorize function, for ABAC, a policy engine (OPA, Cedar) or per-tenant ownership checks.
@xtandard/links/hooks/log 2 A reference hook: createLogHook() logs mutation events.
@xtandard/links/bridges/webhooks 4 Ecosystem bridge to @xtandard/webhooks (structural typing; no dependency).
@xtandard/links/bridges/audit 3 Ecosystem bridge to @xtandard/audit (structural typing; no dependency).
@xtandard/links/elysia 7 Elysia 1.x adapter: linksPanel() to mount the panel as a plain handler, linksElysia(), a typed plugin whose admin routes Eden treaty can see, and linksRedirect(), a plugin answering short links before routing.
@xtandard/links/elysia2 3 Elysia 2 adapter: the same surface as @xtandard/links/elysia (linksPanel(), the typed linksElysia() plugin and linksRedirect()), built against Elysia 2 and @elysia/eden.
@xtandard/links/hono 3 Hono adapter: linksPanel() returns a Hono sub-app serving the panel (to compose with app.route(path, panel)), and linksRedirect() is middleware answering short links and calling next() for everything else.
@xtandard/links/express 4 Express adapter: linksPanel() bridges Node’s req/res to the web-standard panel handler, and linksRedirect() is middleware answering short links and calling next() for everything else.
@xtandard/links/bun 5 Bun adapter: linksPanel() returns the web-standard panel handler for Bun.serve({ fetch }), and linksRedirect() answers short links and falls through to a fallback (your app, or the panel).
@xtandard/links/next 8 Next.js adapter (web-standard, no next import): linksRouteHandlers() serves the panel from an app-router catch-all route, and linksMiddleware() (alias linksRedirect()) answers short links from middleware.ts, resolving undefined to continue.
@xtandard/links/react 9 @xtandard/links/react — embed the links dashboard, or the per-tenant analytics widget, as React components in your own app (ADR 0003).