# Custom domains for SaaS: API, widget, SDKs (https://dodomain.io/docs)

Add custom domains to your SaaS. Create a connect session over REST, your user connects DNS in a hosted flow, and a signed webhook confirms it.

<DocsIllustration name="connect" />

DoDomain adds custom domains for SaaS products (the DNS half of "bring your own domain", done for you). Instead of building DNS instructions, verification polling, and provider quirks into your own product, you drop in DoDomain: your server mints a _connect session_ over REST, your end user finishes DNS setup in a hosted flow (or an embedded widget), and DoDomain verifies the records against the domain's authoritative nameservers and calls your webhook with a signed event. TLS stays at your own host; DoDomain never proxies traffic.

## How it works [#how-it-works]

1. **Your server creates a session**: one `POST /api/v1/sessions` call describing the DNS records your product needs on the customer's domain (for example a CNAME pointing at your edge).
2. **Your user connects the domain**: the returned `connectUrl` opens a hosted flow that detects the user's DNS provider and picks the best path: on Cloudflare it offers a real one-click apply via OAuth; everywhere else it shows provider-specific, copy-paste instructions with live per-record verification.
3. **DoDomain verifies and tells you**: records are checked against the domain's authoritative nameservers, and a signed `connection.verified` webhook fires the moment everything matches.
4. **Monitoring keeps it honest, free, on every plan**: verified connections are re-checked automatically (every 10 minutes for their first day, then hourly for a week, then every 6 hours); if DNS drifts, the suspicion is confirmed on three consecutive checks, you get a `connection.failed` webhook naming the failing records, and you can trigger a re-verify on demand. There is no "monitored domains" meter and no monitoring add-on: see [Webhooks and monitoring](https://dodomain.io/docs/webhooks#automatic-dns-drift-monitoring).

## The pieces [#the-pieces]

<Cards>
  <Card
    title="Getting started"
    href="https://dodomain.io/docs/getting-started"
    description="Sign in, create an app, mint your first connect session, and receive the webhook."
  />
  <Card
    title="The connect flow"
    href="https://dodomain.io/docs/connect-flow"
    description="Hosted page, embeddable widget, provider detection, and the connect tiers."
  />
  <Card
    title="Webhooks and monitoring"
    href="https://dodomain.io/docs/webhooks"
    description="The signature scheme, the five events, and the built-in DNS monitor."
  />
  <Card
    title="REST API"
    href="https://dodomain.io/docs/api"
    description="Every /api/v1 endpoint, authentication, and rate limits."
  />
  <Card
    title="SDKs"
    href="https://dodomain.io/docs/sdks"
    description="@dodomain/node or dodomain-sdk for your server, @dodomain/connect for your frontend."
  />
  <Card
    title="AI assistants (MCP)"
    href="https://dodomain.io/docs/connecting-ai-assistants"
    description="Connect Claude or any MCP client to DoDomain with one URL."
  />
  <Card
    title="Guide: multi-tenant Next.js"
    href="https://dodomain.io/docs/guides/custom-domains-multi-tenant-nextjs"
    description="Host-header routing in proxy.ts, activation from the webhook, where TLS terminates, and the apex answer."
  />
  <Card
    title="Guides: Rails, Laravel, Django"
    href="https://dodomain.io/docs/guides/custom-domains-multi-tenant-rails"
    description="The same three problems on Rails 8, Laravel 12 and Django 5, each with the framework's own host trap, a tested webhook verifier, and where TLS terminates on that stack."
  />
  <Card
    title="DNS provider setup guides"
    href="https://dodomain.io/docs/guides/dns-providers"
    description="One page per provider: GoDaddy, Namecheap, Cloudflare, Squarespace, Wix, Hover, Porkbun and more, generated from what the connect flow shows customers."
  />
  <Card
    title="Domain Connect field notes"
    href="https://dodomain.io/docs/guides/domain-connect-field-notes"
    description="Three providers end to end and every bug on the way: sig/key order, chunked keys, a provider's exponentiation bug, served-not-proven."
  />
</Cards>

Still choosing a route? [Custom domains for SaaS: every option compared](https://dodomain.io/compare) weighs DoDomain against Cloudflare for SaaS, Entri, Approximated and building it yourself.

## Where things live [#where-things-live]

- **dodomain.io**: the marketing site and public docs; [dodomain.io/changelog](https://dodomain.io/changelog) is the dated record of what shipped.
- **app.dodomain.io**: the dashboard, the hosted connect flow, and the API base URL.
- **npm**: `@dodomain/node` (server SDK) and `@dodomain/connect` (browser widget), both MIT-licensed with zero runtime dependencies.
- **PyPI**: `dodomain-sdk` (Python server SDK, sync and async), MIT-licensed, `httpx` its only dependency.
