One TypeScript client for customer domains. Add a hostname to the platform you already run, return the exact DNS records your customer needs, track it until it is ready, and remove it safely.
- Adapters for Vercel, Cloudflare for SaaS, Railway, Render, and Netlify
- One normalized lifecycle for adding, reading, listing, verifying, and removing domains
- Exact routing, ownership, and certificate records for customer-facing DNS instructions
- Provider-authoritative verification and certificate status without false readiness
- Idempotent add and remove operations with normalized, retry-aware errors
- Sequential polling with timeouts, cancellation, callbacks, and provider backoff
- An isolated testing adapter that never calls a real provider
npm install @opencoredev/domain-sdkDomain SDK is server-side only and requires Node 20+ or Bun. Keep provider credentials out of browser code.
import { createDomainClient } from "@opencoredev/domain-sdk";
import { vercel } from "@opencoredev/domain-sdk/vercel";
const domains = createDomainClient({
provider: vercel({
token: process.env.VERCEL_TOKEN!,
projectId: process.env.VERCEL_PROJECT_ID!,
}),
});
const domain = await domains.add("app.customer.com");
for (const record of domain.records.filter((record) => record.required)) {
console.log(record.type, record.name, record.value);
}
const active = await domains.waitUntilActive(domain.hostname);Vercel, Cloudflare for SaaS, Railway, Render, Netlify, and an in-memory testing adapter. Each provider lives behind its own entry point and preserves the platform-specific DNS and verification details your UI needs.
Full docs live at domain-sdk.dev/docs. Good places to start:
bun install
bun run dev
bun run test
bun run check-types
bun run lint
bun run buildThe docs run at http://domain-sdk.localhost:1355 through the sudo-free Portless proxy. Use PORTLESS=0 bun run dev to bypass the proxy.
Add a Tegami changelog under .tegami/, then run the complete local release:
bun run releaseThe release tooling requires Node.js 24 or newer.
The command lints, type-checks, and tests the SDK; versions it with Tegami; builds the package; publishes it to npm; and removes the completed publish lock. If publishing fails, Tegami keeps the lock so bun run tegami publish can retry safely.
Built by @leodev
