Add Custom Domain

Server action for programmatically adding a custom domain to a Vercel project

import {  addDomain,  getDomainStatus,} from "@/components/vercel-platform/src/actions/add-custom-domain";const example = async () => {  const added = await addDomain("test.com");  if (added.status === "Valid Configuration") {    // do something  }  const config = await getDomainStatus("test.com");  config.dnsRecordsToSet; // show this in a table};export default example;

Overview

The Add Custom Domain action is a server-side utility that allows platforms to programmatically add custom domains to Vercel projects and check their configuration status. This enables platforms to manage domain verification and DNS configuration on behalf of their users, providing a seamless experience for connecting custom domains to deployments.

On this page