Dub.co Review 2026: The Best Link Shortener for Developers and Indie Hackers
Dub.co is an open-source, developer-first link shortener with analytics, custom domains, and a powerful API. Here's a full review and tutorial for integrating it into your Next.js app.
Bit.ly costs $35/month. Rebrandly is confusing. TinyURL is... still TinyURL. If you're a developer or indie hacker who needs smart short links with real analytics, there's a better option in 2026: Dub.co.
I've been using Dub for the past several months across multiple projects. Here's an honest review of what it does well, what it doesn't, and how to integrate it into a Next.js app.
What Is Dub.co?
Dub is an open-source link management platform built specifically for developers. It's not just a shortener — it's a full link infrastructure tool with:
- Custom domains (use
links.yourapp.cominstead ofdub.sh) - Click analytics with geo, device, browser breakdowns
- UTM parameter management
- Link expiration and password protection
- Webhooks for real-time events
- A TypeScript SDK and REST API
- Team workspaces and link tags
The open-source angle matters: you can self-host it if you need full data sovereignty, or use their managed cloud (which is what I recommend for most teams).
Setting Up the Dub.co API in Next.js 15
First, grab your API key from the Dub dashboard and install the SDK:
npm install dub
# or
pnpm add dub
Create a reusable Dub client:
// lib/dub.ts
import { Dub } from 'dub'
export const dub = new Dub({
token: process.env.DUB_API_KEY!,
})
// Helper to create a short link with UTM params
export async function createShortLink(options: {
url: string
slug?: string
utm?: {
source?: string
medium?: string
campaign?: string
}
}) {
const link = await dub.links.create({
url: options.url,
domain: 'links.yourapp.com', // your custom domain
key: options.slug,
utm_source: options.utm?.source,
utm_medium: options.utm?.medium,
utm_campaign: options.utm?.campaign,
trackConversion: true,
})
return link
}
Real Use Case: Auto-Generated Share Links
Here's a practical example — a Server Action that creates a tracked short link whenever a user shares a blog post:
// app/actions/share.ts
'use server'
import { dub } from '@/lib/dub'
import { revalidatePath } from 'next/cache'
export async function generateShareLink(postId: string, postSlug: string) {
const baseUrl = `https://yoursite.com/blog/${postSlug}`
// Create short link with analytics tracking
const link = await dub.links.create({
url: baseUrl,
key: `blog-${postSlug}`,
utm_source: 'share_button',
utm_medium: 'social',
utm_campaign: `post_${postId}`,
expiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // 30 days
})
return {
shortUrl: link.shortLink,
clicks: link.clicks,
qrCode: `https://api.dub.co/qr?url=${encodeURIComponent(link.shortLink)}`
}
}
// In your component:
// const { shortUrl, qrCode } = await generateShareLink(post.id, post.slug)
This gives every shared link its own analytics. You can see exactly how many people clicked a specific share button, from which country, on which device — without any third-party analytics script on your frontend.
Analytics That Actually Make Sense
Dub's analytics dashboard is genuinely good. You get:
- Timeseries clicks with hourly/daily/monthly breakdowns
- Top countries — critical for content and ad targeting decisions
- Device/browser/OS breakdown — know if your audience is iOS-heavy or desktop-dominant
- Referer tracking — see which platforms actually drive traffic
You can also pull this data via the API to build custom dashboards or integrate it with your product analytics.
Pricing
- Free: 1 workspace, 25 short links, basic analytics, 1 custom domain
- Pro ($19/month): Unlimited links, 3 custom domains, advanced analytics, API access, webhooks
- Business ($49/month): 10 domains, team members, SAML SSO, priority support
For indie hackers, the free tier is surprisingly usable for getting started. The Pro plan at $19/month is genuinely competitive against Bit.ly's $35 plan — and Dub gives you better analytics and developer tooling.
What I'd Improve
A few rough edges: the custom domain setup requires DNS knowledge that non-technical users might struggle with. The free tier's 25-link limit also fills up faster than you'd expect if you're generating links programmatically. And the UI, while clean, could surface analytics more prominently on the main dashboard.
Verdict
If you're building a SaaS, a content platform, or any app where links matter — Dub.co is the obvious choice in 2026. It's developer-first, has a great SDK, and the pricing is fair. The open-source option means you're not locked in forever.
Start free at dub.co — no credit card required.
Takeaways
- Dub.co is the best link shortener for developers in 2026 — custom domains, analytics, and a TypeScript SDK
- Use the
dubnpm package for seamless Next.js integration - Server Actions + Dub = auto-generated tracked share links with zero client JS
- Free tier covers most indie hacker use cases; Pro at $19/month beats Bit.ly on value
- Open-source and self-hostable if data sovereignty is a requirement
Admin
Dub.co
Short links & analytics for developers — track clicks, create branded links, manage affiliate URLs with ease.
Bài viết liên quan
How to Deploy a Node.js App on DigitalOcean: Droplet + Nginx + PM2 + SSL in 2026
A practical step-by-step guide to deploying a production Node.js application on a DigitalOcean Droplet with Nginx as a reverse proxy, PM2 for process management, and a free Let's Encrypt SSL certificate.
Comments (0)
Sign in to comment
No comments yet. Be the first to comment!