Skip to content

@xtandard/links/core

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.

The redirect plane (createRedirectHandler) reads through a memory-first resolver on top of this core; nothing here is on the per-request hot path except the batched click counters.

import { … } from "@xtandard/links/core";
Name Summary
createLinksCore Create the links control plane.
publicLink Strip secrets from a link for API responses: the password hash becomes hasPassword.
Name Summary
ConflictError Thrown when a slug, external id or hostname is already taken. Maps to HTTP 409.
NotFoundError Thrown when a referenced tenant/domain/link does not exist. Maps to HTTP 404.
ReadonlyError Thrown by mutating operations when the core is in readonly mode.
Name Summary
ActorOptions Options accepted by mutating calls.
ConversionResult Result of a conversion call; null when the click/customer is unknown.
CreateLinkInput Input for LinksCore.createLink. Everything but url is optional.
ImportResult Result of LinksCore.importLinks.
ImportRowResult One row’s outcome in an import.
LinkChange A change notification for resolver caches.
LinkPage A page of links.
LinksCore The control plane.
LinksCoreOptions Options for createLinksCore.
ListLinksQuery Query for LinksCore.listLinks.
TrackLeadInput Input for LinksCore.trackLead.
TrackSaleInput Input for LinksCore.trackSale.
Name Summary
ImportConflictPolicy How LinksCore.importLinks treats rows whose slug or external id exists.
UpdateLinkInput Input for LinksCore.updateLink: any subset; null clears a field.