Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

597 B
Raw Blame
import { assertValidDomainFormat, CustomResponse } from "./utils";

export const configureVercelNameservers = async (
  domain: string,
): Promise<CustomResponse> => {
  assertValidDomainFormat(domain);
  return await fetch(
    `https://api.vercel.com/v3/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
    {
      method: "PATCH",
      headers: {
        Authorization: `Bearer ${process.env.VERCEL_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        op: "update",
        zone: true,
      }),
    },
  ).then((res) => res.json());
};