Domain SDK
API Reference

createSubdomainClient

Scope tenant hostname operations to direct children of one owned parent domain.

Signature
createSubdomainClient(options: {
  domainClient: DomainClient;
  baseDomain: string;
  reservedLabels?: readonly string[];
}): SubdomainClient
MemberReturnsBehavior
baseDomainstringNormalized parent hostname.
wildcardHostnamestringNormalized *.baseDomain hostname.
supportsWildcardbooleanSelected provider's wildcard capability.
toHostname(label)stringNormalize and constrain a direct-child label.
fromHostname(hostname)stringValidate the parent boundary and return its normalized label.
add/get/refresh/verify/remove(label)lifecycleRun the matching operation for one tenant hostname.
waitUntilActive(label)DomainPoll one tenant hostname until active.
provisionWildcard() and wildcard lifecycle methodslifecycleAdd, get, refresh, verify, or remove the wildcard hostname.
waitUntilWildcardActive()DomainPoll the wildcard hostname until active.

Labels must contain exactly one DNS label. Reserved labels, wildcards, nested subdomains, and hostnames outside baseDomain are rejected before any provider request.

The client does not allocate labels or store tenant ownership. Claim the normalized label with a unique database constraint and authorize all changes in the application layer.

Read next: Give tenants managed subdomains.