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")
Custom domains,handled.
Add, verify, monitor, and remove customer domains with one TypeScript API.
Add the hostname. Return the exact DNS. Track it until the domain is ready.
Everything your custom-domain flow needs. One API.
Domain SDK keeps platform-specific APIs at the edge of your system and returns a model your product can render directly.
Honest readiness
Routing, ownership, and certificate state stay separate until the provider confirms the domain is ready.
Change the adapter.
Keep the workflow.
vercel()railway()DNS instructions your UI can trust
Explore the model_vercel.app.customer.comownershipapp.customer.comrouting_acme-challenge.app.customer.comcertificateYour complete domain workflow, already handled.
Your application owns tenant authorization and state. Domain SDK talks to the configured platform. The provider remains the source of truth.
Compare providersEverything needed for the lifecycle. Nothing pretending to be magic.
Attach a hostname
Validate once, add it to the configured resource, and safely handle repeat requests.
Return exact DNS
Give customers routing, ownership, and certificate records with clear purposes and status.
Wait for the provider
Poll sequentially with cancellation and backoff. Mark active only when the provider does.
Disconnect safely
Remove only from the configured provider scope and treat an already-absent hostname as success.
Add the hostname. Show the records. Wait for ready.

