Skip to content

@xtandard/links/schema

Core type definitions for @xtandard/links.

This module is types only — no runtime code beyond tiny constants, no dependencies. It is safe to import from the redirect hot path and from edge runtimes. Runtime validation (which pulls in valibot) lives in validation.

import { … } from "@xtandard/links/schema";
Name Summary
Actor Identity captured on audit records and passed by callers of audited mutations.
AnalyticsEventBase Fields common to every analytics event.
AndroidAppConfig Android app association for a domain (assetlinks.json).
AuditEntry One entry in the internal operator audit log.
ClickDimensions The click’s dimensions, copied onto the click ref and onto the lead/sale events it attributes, so conversions break down by country, device, referrer, … like clicks do.
ClickEvent A recorded click on a short link. Its id is the attribution click id.
ClickRef Minimal click record kept in storage for attribution (pruned after the window).
Customer A host customer bound to the click that brought them (first lead wins).
DeferredHandoff A pending deferred deep-link handoff (ADR 0008).
Domain A short-link domain (go.acme.com). Domains are either shared by every tenant (tenant unset) or owned by one tenant (a customer’s branded domain). DNS and TLS for the hostname are the host’s responsibility.
GeoInfo Geo information resolved for a request.
IosAppConfig iOS app association for a domain (apple-app-site-association).
LeadEvent A lead (signup) attributed to a click (ADR 0010).
Link A short link.
LinkDeepLink Deep-link settings for a link (ADR 0008).
LinkPreview Link-preview (Open Graph) overrides served to unfurlers.
LinkRule A targeting rule: when every condition matches, redirect to url or pick one of variants deterministically per visitor. Rules are evaluated in order; the first match wins (ADR 0011).
PasswordHash A stored password verifier (PBKDF2-SHA256, Web Crypto). Never returned by the API.
QueryCondition A condition on a query-string parameter of the short URL.
SaleEvent A sale attributed to a click through its customer (ADR 0010).
SlugPointer Where a slug points: the owning tenant and link id.
Tenant A tenant is the unit of ownership — typically one of your customers or workspaces. Links are scoped to a tenant; a viewer token grants read access to exactly one tenant. Tenants are created implicitly by the first link.
TimeCondition A time-window condition (ISO-8601 bounds, either optional).
Utm UTM parameters merged into the destination’s query string.
ValueCondition A condition over a request dimension: field value is (not) one of values.
Variant A weighted A/B destination.
Name Summary
AnalyticsEvent Any event flowing into the analytics sink.
Condition Any rule condition.
ConditionField Fields a rule condition can test (ADR 0011).
DeviceType Device class derived from the user agent.
JsonObject A JSON object.
JsonValue JSON-serializable value, used for metadata.
LinksDuration A duration for configuration options: milliseconds as a number, or a string such as "5s", "30m", "2h", "90d". Parsed by ./duration.durationToMs.
RedirectStatus HTTP status used for the redirect.
Name Summary
DEFAULT_TENANT The tenant used when the host does not pass one (single-tenant installs).
SCHEMA_VERSION Current schema version for stored records.