dubinc/dub-ts

Include Enum of Default Domains

versecafe opened this issue · 0 comments

Proposal

Include an enum containing all the default domains something like

export enum Domains {
  DUB = "dub.sh",
  CHAT_GPT = "chatg.pt",
  AMAZON = "amzn.id",
  SPOTIFY = "spti.fi",
}

This would make it harder for a user to accidentally put a typo into their domain making a standard create call look like

const link = await dub.links.create({
  url: "google.com",
  domain: Domains.DUB,
});