Custom domains and DNS SDK for TypeScript
Domain SDK docs. Add and verify SaaS customer domains on Vercel, Cloudflare, Railway, Render, and Netlify, and write DNS records at Porkbun, Namecheap, and Spaceship.
Domain SDK handles the custom-domain lifecycle across Vercel, Cloudflare for SaaS, Railway, Render, Netlify, and bunny.net. Add a hostname, show your customer the exact DNS records, and track provider state until the domain is ready.
import { createDomainClient } from "@opencoredev/domain-sdk";
import { vercel } from "@opencoredev/domain-sdk/vercel";
export const domains = createDomainClient({
provider: vercel({
token: process.env.VERCEL_TOKEN!,
projectId: process.env.VERCEL_PROJECT_ID!,
}),
});
Use Domain SDK when your SaaS needs to show exact DNS instructions, track provider-authoritative status, and keep provider-specific APIs out of the rest of your application. It does not register domains, host DNS, deploy apps, proxy traffic, or store tenant data.
Read next
Install Domain SDK
Compare providers
Build a domain settings page
Understand the domain lifecycle
Use the DNS records component
Browse the API reference
The blog has longer guides with working code: custom domains for SaaS, Cloudflare for SaaS custom hostnames, the Porkbun API, and the Namecheap API.