Integrate with Dub using TypeScript

Integrate Dub's link management infrastructure in your TypeScript application with just a few lines of code.

Trusted by industry leaders and pioneers

VERCELPRISMARAYCASTCLERKHASHNODEPERPLEXITYCALREPLICATEFRAMERTINYBIRDATTIOAPPWRITE

Dub has helped us gain valuable insights into the link-sharing use case of Ray.so. And all of it with just a few lines of code – thanks to their native SDKs.

Thomas Paul MannThomas Paul MannCEO & Co-Founder, Raycast

Quick Start

Integrate advanced link management capabilities into your projects by checking out the documentation and installing with your preferred package manager.

npm install dub

Integrate your project seamlessly

With the Dub TypeScript SDK, you can programmatically generate short links in just a few lines of code.

import { Dub } from "dub";

const dub = new Dub({
    token: "DUB_API_KEY",
});

const { shortLink } = await dub.links.create({
    url: "https://google.com",
});

Explore API Endpoints

Links
Domains
Tags
More
+ 4 methods
Request
await dub.links.create({
  url: "https://google.com",
});
Response
{
  id: "clv3o9p9q000au1h0mc7r6l63",
  domain: "dub.sh",
  key: "e7qzMuI",
  url: "https://www.google.com",
  ...
}

Dub's API allowed us to programmatically shorten URLs with a single API call, making it easier for our community to share insights into open source.

Brandon RobertsBrandon RobertsEngineering Lead, Opensauced

All you need to get started

Check out our resources to harness the full potential of the Dub TypeScript SDK.

Quickstart Guide

Learn how to create a short link with the Dub TypeScript SDK.

Examples

See example apps that you can build with the Dub TypeScript SDK.

API Reference

Learn about Dub's REST API and its features.

Supercharge
your marketing efforts

See why Dub.co is the link management infrastructure of choice for modern marketing teams.