Site index
Sitemap
Find every guide, supported platform, reusable component, core concept, TypeScript API reference, and blog post in Domain SDK.
Getting started
- Custom domains and DNS SDK for TypeScriptDomain SDK docs. Add and verify SaaS customer domains on Vercel, Cloudflare, Railway, Render, and Netlify, and write DNS records at Porkbun, Namecheap, and Spaceship.
- Install Domain SDK for TypeScriptInstall the server-side TypeScript SDK and start managing SaaS customer domains with Vercel, Cloudflare, Railway, Render, Netlify, or bunny.net.
Guides
- Custom domain implementation guidesBuild secure SaaS custom-domain workflows with practical TypeScript guides for setup, DNS, polling, persistence, testing, and troubleshooting.
- Add and remove customer domainsUse safe idempotency without silently claiming domains from another resource.
- Build a custom-domain settings pageConnect an authenticated tenant endpoint to Domain SDK without exposing credentials.
- Display DNS records correctlyGive customers complete instructions without registrar-specific assumptions.
- Give tenants managed subdomainsGive each tenant a subdomain like acme.mydomain.com with createSubdomainClient: reserved labels, a single wildcard, or one hostname per tenant.
- Handle apex domains and subdomainsRespect adapter capabilities without guessing public-suffix boundaries.
- Poll until a domain is activeWait until a custom domain reaches the provider-reported active state with waitUntilActive: timeouts, intervals, AbortSignal cancellation, and Retry-After backoff.
- Production credential setupScope and store platform credentials for server-side domain management.
- Store domain state in your databasePersist tenant ownership and cached UI state while keeping the provider authoritative.
- Switch providers safelyBuild a deliberate migration without pretending Domain SDK moves live traffic.
- Tenant authorization and domain securitySecure customer custom domains in a multi-tenant app: authorize every call by tenant, rate-limit changes, and prevent abandoned-domain takeover.
- Test without external API callsSimulate latency, failures, transitions, and calls with isolated memory providers.
- Troubleshoot custom domain SSL certificatesCheck when a custom domain's SSL certificate is ready with domain.certificate.status, and fix certificates stuck pending: routing, ownership, CAA, DNSSEC, and proxies.
- Troubleshoot pending DNSDiagnose routing and ownership records that remain pending or invalid.
Providers
- Custom domain provider comparisonCompare custom domain support across Vercel, Cloudflare for SaaS, Railway, Render, Netlify, and bunny.net, plus the Porkbun, Namecheap, and Spaceship DNS adapters.
- bunny.net custom domainsAdd, verify, monitor, and remove customer hostnames on a bunny.net CDN pull zone with a typed server-side TypeScript adapter.
- Cloudflare for SaaS custom hostnames: setup and APIHow Cloudflare for SaaS custom hostnames work: the fallback origin, the CNAME target your customers point to, hostname and certificate validation, and a TypeScript client for the Custom Hostnames API.
- Namecheap DNS records: BasicDNS API adapterSet Namecheap DNS records (A, AAAA, CNAME, ALIAS, TXT, CAA) from TypeScript: why the API needs BasicDNS, IP whitelisting, whole-list setHosts writes, and limits.
- Netlify custom domain: DNS records, 75.2.60.5, and the APIPoint a custom domain at Netlify: a CNAME to your .netlify.app subdomain, or for an apex domain an ALIAS to apex-loadbalancer.netlify.com or an A record to 75.2.60.5. SSL, site ID, and the API.
- Porkbun DNS records: the TypeScript adapterWrite Porkbun DNS records (A, AAAA, CNAME, ALIAS, TXT, CAA) from TypeScript: API keys, per-domain API Access, nameserver checks, TTLs from 600 seconds, and errors.
- Railway domains: custom domain DNS, SSL, and the APIAdd a custom domain to Railway: a CNAME to your up.railway.app target, a TXT record for ownership, CNAME flattening or ALIAS at the root, automatic SSL, and the API.
- Render custom domain: DNS records, verification, and the APIAdd a custom domain to Render: CNAME to your onrender.com subdomain, ALIAS or A 216.24.57.1 for a root domain, then Verify. Plan limits, SSL, and the API.
- Spaceship API: DNS records from TypeScriptWrite DNS records with the Spaceship API from TypeScript: API key and secret headers, dnsrecords permissions, save and delete calls, rate limits, and the SDK adapter.
- Testing providerExercise domain flows without credentials, network calls, or shared state.
- Vercel custom domains: DNS records, limits, and the APIAdd a custom domain to Vercel: an A record for the apex (76.76.21.21 or your project's value), a CNAME for subdomains, the _vercel TXT check, limits, and the API.
Components
- Custom domain UI componentsAdd accessible, copy-ready DNS instructions and optional one-click DNS setup to a React custom-domain settings page.
- DNS records UI componentAdd a copy-ready React DNS records table to your SaaS domain settings page so customers can configure routing, ownership, and certificates.
- One-click DNS setup componentSend customers from your SaaS domain settings page to a supported DNS provider for reviewed, automatic record configuration.
Concepts
- Custom domain architecture conceptsUnderstand the domain lifecycle, DNS records, ownership verification, managed TLS, provider capabilities, status, errors, and tenant security.
- DNS records in the SDK: types, status, and zone writesThe DNS records Domain SDK returns for a custom domain: type, full name, value, purpose, and status. Show them to customers, or write them to a DNS zone with createDnsClient.
- Domain lifecycleHow a custom domain moves from add through DNS setup, verification, and waitUntilActive to remove, and how the SDK handles repeat adds and conflicts.
- Error handlingHandle DomainSdkError codes for auth, conflicts, rate limits, timeouts, and provider outages, with retryable flags, retryAfter, and redacted details.
- Managed certificatesTrack provider-managed TLS issuance separately from DNS and ownership.
- Ownership verificationProve a customer controls a hostname without collecting registrar credentials.
- Platform providersUnderstand what adapters normalize and what remains provider-specific.
- Provider capabilitiesDetect optional list, verification, certificate, apex, and wildcard behavior.
- Security modelKeep provider credentials server-side and tenant ownership in your application.
- Status modelUse overall, verification, certificate, and DNS-record states without false precision.
API reference
- Domain SDK TypeScript API referenceReference the typed clients, provider contract, domain model, DNS records, lifecycle status, errors, polling, and isolated testing utilities.
- createDomainClientCreate a stateless client from a provider and optional silent-by-default logger.
- createSubdomainClientScope tenant hostname operations to direct children of one owned parent domain.
- DnsRecordDnsRecord type reference: record type, name, value, TTL, purpose (routing, ownership, certificate), and status, ready to show in a custom-domain settings UI.
- DomainDomain type reference: the provider-independent state every lifecycle read returns, including status, DNS records, verification, certificate, and issues.
- DomainClientDomainClient reference: add, get, refresh, list, verify, remove, and waitUntilActive for customer custom domains, with normalized results on every provider.
- DomainProviderDomainProvider contract: the add, get, list, verify, and remove methods and the capabilities a platform adapter implements to plug into Domain SDK.
- DomainSdkErrorStructured, sanitized failures shared by the core and provider adapters.
- DomainStatusDomainStatus values, from pending and pending_dns to active, misconfigured, and failed. Only active means a custom domain is ready for production traffic.
- Testing utilitiesTest custom-domain code without network calls using memoryProvider, createMockDomain, createMockDnsRecord, and createFailingProvider from the testing subpath.
- waitUntilActiveSequential polling with timeout, cancellation, callback, and retry backoff.
Project
- Domain SDK projectFollow Domain SDK releases, inspect the open-source project, and learn how to contribute provider adapters, fixes, documentation, or tests.
- ChangelogUser-visible Domain SDK releases and compatibility changes.
- ContributingSet up the workspace, make a focused change, and run the repository checks.
Blog
- Cloudflare for SaaS: custom hostnames, setup, and pricingCloudflare for SaaS in practice: what custom hostnames cost and when pending ones bill, which validation method to pick, why hostnames get stuck, the errors customers hit, and the API calls in TypeScript.
- Custom domains for SaaS: how to let customers use their own domainHow to offer customer custom domains in a SaaS app: the DNS records, ownership check, TLS certificate and Host routing, four ways to build it, and the TypeScript code.
- Domain Connect: one-click DNS setup for SaaS custom domainsHow Domain Connect works for a SaaS app: discovery, templates, signed apply URLs, Cloudflare onboarding, and TypeScript code that sends customers to approve DNS records.
- Domain verification with TXT records: how SaaS apps verify customer domainsVerify that a customer owns their custom domain with a DNS TXT record: the token, the DNS check, re-verification, and the TXT records Vercel, Cloudflare and Railway need.
- GoDaddy API: API keys and DNS records from TypeScriptHow the GoDaddy API works in 2026, from Personal Access Tokens and scopes to account rules and the v3 DNS records endpoints, with fetch samples and a Domain SDK adapter you can copy.
- Namecheap API: access, keys, and DNS in TypeScriptNamecheap API access requirements and rate limits, how to get an API key and whitelist your IP, and managing DNS with getHosts and setHosts in TypeScript.
- Namecheap vs Porkbun for developers: API access, DNS, and automationA developer's comparison of Namecheap and Porkbun: who can use each API, IP whitelisting, sandboxes, JSON vs XML, per-record vs whole-zone DNS writes, and rate limits.
- Porkbun API: create DNS records from TypeScriptHow to get Porkbun API keys, turn on API access for a domain, and create, list, and delete DNS records with fetch or Domain SDK.
- Railway API: add custom domains with GraphQL from TypeScriptUse the Railway public GraphQL API to add a custom domain, read its DNS records and certificate status, and remove it from TypeScript, with tokens and rate limits.
- Vercel Platforms Starter Kit: add customer custom domainsThe Vercel Platforms Starter Kit only does subdomains. Add customer custom domains with the Vercel API: attach the hostname, show its DNS records, and route it in proxy.ts.
- What is an apex domain? Apex DNS records explainedAn apex domain is the root of a DNS zone, like customer.com. Why it can't hold a CNAME, and which apex record (A, ALIAS, or flattened CNAME) each host asks for.
- Wildcard subdomains for multi-tenant apps: DNS, SSL, and routingHow a wildcard subdomain (*.example.com) works, why its SSL certificate needs DNS-01, the records Vercel, Render, Railway, Netlify, and bunny.net need, and tenant routing.