Official U301 SDK to create branded short links, manage links, and access analytics. Built for Bun and Node with first-class TypeScript support.
Currently, we only provide a TypeScript SDK for Node.js and Bun. For other environments, you
can use the REST API directly.
Install TypeScript SDK
npm install u301The TypeScript SDK is still in development. We value your feedbacks.
Quick Start
import { U301 } from 'u301';
const apiKey = '<YOUR_API_KEY>';
const workspaceId = '<YOUR_WORKSPACE_ID>';
const u301 = new U301({
apiKey,
workspaceId,
});
const link = await u301.links.create({
url: 'https://example.com',
domain: 'u301.co',
slug: 'launch',
});Analytics
import { U301 } from 'u301';
const apiKey = 'YOUR_API_KEY';
const workspaceId = 'YOUR_WORKSPACE_ID';
const u301 = new U301({
apiKey,
workspaceId,
});
const report = await u301.analytics.getClicks({
range: '1m',
granularity: 'day',
timezone: 'Europe/London'
})Last updated on
