Domain SDK
Providers

Render custom domain: add one with the API

How to add a custom domain to a Render web service or static site through the Render API, point its DNS, verify it, and wait for TLS, with a TypeScript example.

To add a custom domain to a Render service by hand, open the service's Settings, click + Add Custom Domain under Custom Domains, add the DNS records Render shows at your DNS provider, then click Verify. Render issues and renews the TLS certificate automatically. To do the same from code, POST the hostname to the Render API's /v1/services/{serviceId}/custom-domains endpoint, then call its /verify endpoint once DNS is in place. This adapter wraps both calls and returns the DNS records your customer needs.

Scope and credentials

The adapter creates, retrieves, lists, verifies, and removes custom domains for one Render service. Set RENDER_API_KEY and RENDER_SERVICE_ID. The service must be a web service or static site, and the API key must have access to it.

domains.ts
import { createDomainClient } from "@opencoredev/domain-sdk";
import { render } from "@opencoredev/domain-sdk/render";

export const domains = createDomainClient({
  provider: render({
    apiKey: process.env.RENDER_API_KEY!,
    serviceId: process.env.RENDER_SERVICE_ID!,
  }),
});

const domain = await domains.add("app.customer.com");

DNS, verification, and certificates

Subdomains return a CNAME pointing to the service's onrender.com hostname. Apex domains return Render's 216.24.57.1 load-balancer address and explain the preferred ALIAS, ANAME, or flattened-CNAME alternative. Apex domains: A records, ALIAS, and CNAME flattening compares the two for customer DNS hosts. Wildcards also return Render's certificate and hostname-validation CNAME records.

Call verify() after the customer configures DNS. Render also verifies new domains automatically, so polling with waitUntilActive() remains useful. A verified domain becomes active; Render manages its TLS certificate but does not expose certificate metadata through the custom-domain response.

Errors and limitations

Adding a root or www hostname can cause Render to create its companion hostname automatically. The adapter returns the hostname you requested, while list() includes every domain Render created. Domain limits and charges depend on the Render workspace plan.

Official references: Custom Domain API, custom domains, and external DNS.

Read next: Poll until active.