Domain setup infrastructure
Build provider-connected domain setup into your SaaS with exact DNS plans, host-owned credentials, and React flows you control.
DomainKit is a TypeScript toolkit for building provider-connected domain setup into a SaaS product. Your application defines the DNS requirements and owns the customer, credential, persistence, and policy boundaries. DomainKit supplies the portable connection, planning, authorization, verification, and cleanup lifecycle.
The package root is Effect-native. A secondary Promise facade is available for foreign runtime
boundaries. @domainkit/react provides browser-safe connection, provisioning, verification,
cleanup, and DNS record interfaces over a transport owned by the host application.
npm install domainkitpnpm add domainkityarn add domainkitbun add domainkitQuickstart
Install DomainKit and build your first reviewable DNS plan.
Plans
Understand the immutable plan, authorization, apply, and cleanup lifecycle.
Connect providers
Add OAuth, integration, or API-token authorization without exposing credentials to the browser.
React UI
Use complete flows or compose semantic parts into your own product.
Cloudflare
Connect with OAuth or scoped API tokens and discover the owning account.
Vercel
Preserve personal or team context from a Vercel Integration installation.
Product boundary
| DomainKit owns | Your application owns |
|---|---|
| Provider-neutral DNS requirements and plans | Product-specific DNS requirements |
| Digest-bound plan authorization | Identity, tenancy, consent, and audit policy |
| Cloudflare and Vercel provider integrations | Credential encryption and durable persistence |
| Provider and public-DNS observation | Authenticated routes and product readiness state |
| Receipt-bound cleanup | When and how users may remove records |
| Browser-safe React lifecycle contracts | Branding, surrounding UI, notifications, and telemetry |
Safety model
- Review before mutation. A plan lists creates, exact no-ops, and conflicts before any write.
- Authorize the digest. Apply accepts the reviewed plan plus authorization for that exact digest.
- Fail closed. DomainKit never silently overwrites incompatible DNS state.
- Keep the host in control. Your application owns credential storage, consent, callback routes, persistence, and audit history.
- One implementation. The Effect API is canonical; the Promise API delegates to it.
Packages
| Package | Use it for |
|---|---|
domainkit |
Effect services, programs, schemas, typed failures, and provider modules |
domainkit/promise |
Promise facade for foreign runtime boundaries |
domainkit/testing |
In-memory capabilities and provider conformance tests |
@domainkit/react |
Browser-safe flows and DNS record primitives over a host-owned transport |