A mini link shortener built with the Dub.co TypeScript SDK.
import { Dub } from "dub";
const dub = new Dub({
token: process.env.DUB_API_KEY
workspaceId: "ws_xxxxxxxxxxxx",
});
async function shorten() {
const result = await dub.links.create({
url: "https://google/com",
});
// Handle the result
console.log(result);
}