Domain SDK
Components

One-click DNS Setup

Hand customers from your domain settings to a supported DNS provider for reviewed, automatic record setup.

Set up DNS automatically

Authorize Cloudflare to add 2 required DNS records for app.customer-example.com.

You will review every DNS change at Cloudflare before anything is applied.

Install

Terminal
bunx --bun shadcn@latest add https://domain-sdk.dev/r/one-click-dns-setup.json

Usage

Render this component only after your server has discovered that the hostname and Domain Connect template are supported. The callback should request a short-lived, signed authorization URL from your backend and then redirect the browser.

domain-settings.tsx
import { OneClickDnsSetup } from "@/components/domain/one-click-dns-setup";

<OneClickDnsSetup
  domain={domain}
  dnsProvider="Cloudflare"
  isConnecting={isConnecting}
  error={connectError}
  onConnect={async (domain) => {
    const response = await fetch(`/api/domains/${domain.id}/dns-authorization`, {
      method: "POST",
    });
    const { authorizationUrl } = await response.json();
    window.location.assign(authorizationUrl);
  }}
  onManualSetup={() => setSetupMode("manual")}
/>;

Credentials, DNS discovery, template support checks, request signing, authorization URL generation, callback validation, and post-return refresh belong on the server. Do not construct or sign Domain Connect requests in this component.

Confirmed provider paths

Application providerCustomer DNS providerSetup
VercelCloudflareDomain Connect
RailwayCloudflareDomain Connect
Cloudflare for SaaSAnyManual unless your own Domain Connect template is onboarded
RenderAnyManual records
NetlifyExternal DNSManual records

Cloudflare is the authoritative DNS provider in the confirmed one-click paths above. Eligibility is per hostname and template, so the UI intentionally does not infer support from domain.provider.

Provider references: Vercel Domain Connect, Railway one-click domains, Cloudflare Domain Connect, Render custom domains, and Netlify external DNS.