Relevant source files
The following files were used as context for generating this wiki page:
- apps/web/lib/dub.ts
- apps/web/lib/middleware/link.ts
- apps/web/ui/placeholders/features-section.tsx
- apps/web/scripts/dev/data.json
- apps/web/middleware.ts
- apps/web/app/app.dub.co/dashboard/slug/ee/program/page.tsx
- apps/web/app/ee/app.dub.co/embed/referrals/quickstart.tsx
- apps/web/app/domain/page.tsx
- packages/stripe-app/src/utils/constants.ts
- apps/web/app/ee/partners.dub.co/dashboard/referrals/page.tsx
- packages/hubspot-app/src/app/app-hsmeta.json
- apps/web/app/domain/disabled/page.tsx
- packages/utils/src/constants/main.ts
- apps/web/app/app.dub.co/onboarding/onboarding/steps/welcome/page.tsx
- packages/email/src/templates/broadcasts/dub-product-update-mar26.tsx
- apps/web/app/ee/partners.dub.co/dashboard/programs/programSlug/enrolled/page.tsx
- apps/web/app/api/dub/webhook/route.ts
- apps/web/ui/layout/sidebar/dub-partners-popup.tsx
- apps/web/lib/webhook/sample-events/link-clicked.json
- apps/web/ui/placeholders/cta.tsx
- packages/utils/src/constants/dub-domains.ts
- apps/web/app/ee/app.dub.co/new-program/slug/program/new/overview/page.tsx
- packages/ui/src/nav/content/product-content.tsx
- apps/web/lib/auth/track-dub-lead.ts
- packages/ui/src/nav/content/solutions-content.tsx
- apps/web/app/app.dub.co/onboarding/onboarding/steps/products/page.tsx
- apps/web/scripts/dub-wrapped.ts
- apps/web/app/app.dub.co/dashboard/slug/links/page.tsx
- packages/cli/src/index.ts
- packages/email/src/templates/broadcasts/dub-product-update-summer26.tsx
Overview
Dub is a comprehensive open-source link management and attribution platform engineered for modern marketing teams and high-scale applications. It provides robust infrastructure for shortening and dispatching URLs, capturing real-time click and conversion analytics, and running automated Partner Programs with customizable affiliate rewards. The custom domain home page apps/web/app/domain/page.tsx renders a branded welcome experience and features section for custom domains; see Link Dispatch for link routing and resolution mechanisms. The partner program enrolled page apps/web/app/ee/partners.dub.co/dashboard/programs/programSlug/enrolled/page.tsx renders performance metrics and referral links for affiliates; see Partner Programs for details on enrollment and program participation.
Sources: packages/hubspot-app/src/app/app-hsmeta.json:5, apps/web/app/domain/page.tsx:18
Platform scope and primary capabilities
Core Product Modules and Capabilities
Dub functions as a unified engine combining advanced URL management, real-time analytics, and automated partner marketing infrastructure. The platform organizes its core capabilities around three foundational product pillars: Link Dispatch via Domain Management, Analytics Dashboard telemetry, and Partner Programs with automated Commission Engine payouts. Marketing teams utilize custom domains such as dub.sh along with pre-configured branded slugs including chatg.pt, spti.fi, git.new, cal.link, amzn.id, ggl.link, and fig.page to establish trust and improve click-through rates.
Sources: packages/utils/src/constants/main.ts:1, packages/utils/src/constants/dub-domains.ts:3-134, packages/ui/src/nav/content/product-content.tsx:42-55
The platform exposes its capabilities through structured navigation components and feature suites that span link shortening, audience analytics, and partner management.
| Product Module | Core Functionality | Primary Target Domain / Route |
|---|---|---|
| Dub Links | Short links with personalization, device targeting, geo-targeting, link cloaking, and password protection | /links |
| Dub Analytics | Instant telemetry covering geolocation, device, browser, and referrer data streams | /analytics |
| Dub Partners | Automated affiliate program management, partner onboarding, and revenue attribution | /partners |
| Dub Integrations | External tool connections and data synchronization across ecosystem apps | /integrations |
| Dub API & MCP | Programmatic access via public REST endpoints and AI agent connectivity | /docs/api-reference/introduction |
Sources: apps/web/ui/placeholders/features-section.tsx:66-103, packages/ui/src/nav/content/product-content.tsx:13-82
Note
When new users complete account onboarding, the platform prompts them to define their primary intent via the product selection step, routing them toward link management, analytics tracking, or partner program creation depending on their business objectives.
Sources: apps/web/app/app.dub.co/onboarding/onboarding/steps/products/page.tsx:5-15
Monorepo subsystems and application topology
Architecture and Shared Packages
Dub is organized as a Turborepo monorepo encompassing web applications, specialized marketplace integrations, developer utilities, and email templates. The primary web surface executes on Next.js with a Node.js middleware runtime defined in apps/web/middleware.ts, which inspects incoming requests and routes them across administrative, partner portal, and link-dispatch handlers.
export const config = {
runtime: "nodejs",
matcher: [
/*
* Match all paths except for:
* 1. /api/ routes
* 2. /_next/ (Next.js internals)
* 3. /_proxy/ (proxies for third-party services)
* 4. Metadata files: favicon.ico, sitemap.xml, robots.txt, manifest.webmanifest
*/
"/((?!api/|_next/|_proxy/|favicon.ico|sitemap.xml|robots.txt|manifest.webmanifest).*)",
],
};Sources: apps/web/middleware.ts:20-32
Warning
The Next.js middleware explicitly bypasses /api/, /_next/, /_proxy/, and static metadata files (favicon.ico, sitemap.xml, robots.txt, manifest.webmanifest) via its matcher configuration to ensure low-latency request handling for link redirects.
Sources: apps/web/middleware.ts:20-32
Developer Tooling and Marketplace Extensions
The monorepo bundles dedicated integration packages and command-line utilities. The packages/cli package implements a Commander.js-based terminal interface (dub) supporting commands for authentication, configuration, domain management, short link creation, and link listing.
const program = new Command()
.name("dub")
.description("A CLI for shortening links with the Dub API.")
.version(
packageInfo.version || "1.0.0",
"-v, --version",
"display the version number",
);
program
.addCommand(login)
.addCommand(config)
.addCommand(domains)
.addCommand(shorten)
.addCommand(links);Sources: packages/cli/src/index.ts:17-31
Ecosystem apps are packaged independently, such as packages/stripe-app for Stripe merchant dashboard integration and packages/hubspot-app for HubSpot CRM contact and deal synchronization.
| Package / App | Purpose | Key Constants or Manifest Settings |
|---|---|---|
apps/web | Core web application and edge routing middleware | Runtime: nodejs, Matcher excludes /api/, /_next/, /_proxy/ |
packages/cli | Developer CLI Tool for terminal-based link operations | Program name: dub, Commands: login, config, domains, shorten, links |
packages/stripe-app | Stripe integration utility for client IDs and API hosts | DUB_CLIENT_ID, DUB_HOST, DUB_API_HOST |
packages/hubspot-app | HubSpot app metadata and OAuth configuration | UID: dub, Scopes: oauth, crm.objects.contacts.read, crm.objects.deals.read |
packages/email | React-email templates for product updates and broadcasts | Templates: DubProductUpdateMar26, DubProductUpdateSummer26 |
Sources: apps/web/middleware.ts:20-32, packages/stripe-app/src/utils/constants.ts:2-5, packages/hubspot-app/src/app/app-hsmeta.json:2-20, packages/cli/src/index.ts:17-31, packages/email/src/templates/broadcasts/dub-product-update-summer26.tsx:18-24
Edge request processing and analytics
Middleware Routing and Link Resolution
The root middleware in apps/web/middleware.ts intercepts inbound requests, checks hostnames, and dispatches traffic to specialized handlers Request Routing. Requests targeting application hostnames or admin consoles route to AppMiddleware or AdminMiddleware, whereas link traffic is processed by LinkMiddleware defined in apps/web/lib/middleware/link.ts.
export default async function middleware(req: NextRequest, ev: NextFetchEvent) {
const { domain, path, key, fullKey } = parse(req);
// Axiom logging
logger.info(...transformMiddlewareRequest(req));
ev.waitUntil(logger.flush());
// for app.dub.co
if (isAppHostname(domain)) {
return AppMiddleware(req);
}
// for api.dub.co
if (API_HOSTNAMES.has(domain)) {
return ApiMiddleware(req);
}
// for public stats pages (e.g. d.to/stats/try -> rewrite to [/domain]/[key]/stats)
if (path.startsWith("/stats/")) {
return NextResponse.rewrite(
new URL(
`/${domain}/${encodeURIComponent(path.replace("/stats/", ""))}/stats`,
req.url,
),
);
}
// for .well-known routes
if (path.startsWith("/.well-known/")) {
const file = path.split("/.well-known/").pop();
if (file && supportedWellKnownFiles.includes(file)) {
return NextResponse.rewrite(
new URL(`/wellknown/${domain}/${file}`, req.url),
);
}
}
// default redirects for dub.sh
if (domain === "dub.sh" && DEFAULT_REDIRECTS[key]) {
return NextResponse.redirect(DEFAULT_REDIRECTS[key]);
}
if (ADMIN_HOSTNAMES.has(domain)) {
return AdminMiddleware(req);
}
if (PARTNERS_HOSTNAMES.has(domain)) {
return PartnersMiddleware(req);
}
if (isValidUrl(fullKey)) {
return CreateLinkMiddleware(req);
}
return LinkMiddleware(req, ev);Sources: apps/web/middleware.ts:34-88
LinkMiddleware parses the domain and short key, enforces case sensitivity based on domain configuration, strips inspect-mode suffixes (+), and handles root links (_root). Unsupported keys like .php trigger an immediate redirect with a dub-no-track=1 query parameter and a googlebot: noindex robots header.
export async function LinkMiddleware(req: NextRequest, ev: NextFetchEvent) {
let { domain, fullKey: originalKey, fullPath, searchParamsObj } = parse(req);
if (!domain) {
return NextResponse.next();
}
// encode the key to ascii
// links on Dub are case insensitive by default
let key = punyEncode(originalKey);
if (!isCaseSensitiveDomain(domain)) {
key = key.toLowerCase();
}
const inspectMode = key.endsWith("+");
// if inspect mode is enabled, remove the trailing `+` from the key
if (inspectMode) {
key = key.slice(0, -1);
}
// if key is empty string, set to _root (root domain link)
if (key === "") {
key = "_root";
}
const STATIC_PAGES_CACHE_HEADERS = {
"Vercel-CDN-Cache-Control": "public, s-maxage=86400",
"Vercel-Cache-Tag": linkCache._createStaticPagesCacheKeys({
domain,
key: originalKey || "_root",
}),
};
// we don't support .php links (too much bot traffic)
// hence we redirect to the root domain and add `dub-no-track` header to avoid tracking bot traffic
if (isUnsupportedKey(key)) {
return NextResponse.redirect(new URL("/?dub-no-track=1", req.url), {
headers: {
...DUB_HEADERS,
"X-Robots-Tag": "googlebot: noindex",
},
status: 302,
});
}Sources: apps/web/lib/middleware/link.ts:43-87
Warning
The middleware skips click tracking during Redis failover events by evaluating redisFailOver, falling back to a no-op handler to prevent request timeouts and cascading latency degradation Caching & Rate Limiting.
Sources: apps/web/lib/middleware/link.ts:89-99
Caching and Telemetry Streaming
When a short link is requested, LinkMiddleware queries Redis cache via linkCache.get. If the link is missing, it fetches record data via getLinkViaEdge from PlanetScale Database Architecture. If the domain is buff.ly, it invokes crawlBitly; otherwise, it returns a 404 rewrite Data Importers.
if (!cachedLink) {
let linkData = await getLinkViaEdge({
domain,
key,
});
if (!linkData) {
if (domain === "buff.ly") {
return await crawlBitly(req, ev);
}
return NextResponse.rewrite(new URL(`/${domain}/notfound`, req.url), {
headers: {
...DUB_HEADERS,
...STATIC_PAGES_CACHE_HEADERS,
},
});
}Sources: apps/web/lib/middleware/link.ts:100-117
For partner links, the middleware fetches partner enrollment info and caches the enriched link object using ev.waitUntil to avoid blocking the synchronous response path.
isPartnerLink = Boolean(linkData.programId && linkData.partnerId);
// format link to fit the RedisLinkProps interface
cachedLink = formatRedisLink(linkData as any);
ev.waitUntil(
(async () => {
if (!isPartnerLink) {
await linkCache.set(linkData as any, { skipRevalidateTag: true });
return;
}
const { partner, discount } = await getPartnerEnrollmentInfo({
programId: linkData.programId,
partnerId: linkData.partnerId,
linkId: linkData.id,
});
// we'll use this data on /track/click
await linkCache.set(
{
...(linkData as any),
...(partner && { partner }),
...(discount && { discount }),
},
{ skipRevalidateTag: true },
);
})(),
);
}Sources: apps/web/lib/middleware/link.ts:119-148
| Middleware Handler | Target Condition | Action / Destination |
|---|---|---|
AppMiddleware | isAppHostname(domain) | Routes to multi-tenant application dashboard |
ApiMiddleware | API_HOSTNAMES.has(domain) | Routes to public REST API handler |
AdminMiddleware | ADMIN_HOSTNAMES.has(domain) | Routes to internal administrative moderation console |
PartnersMiddleware | PARTNERS_HOSTNAMES.has(domain) | Routes to affiliate partner portal |
LinkMiddleware | Default link path | Resolves short link, checks cache, and redirects |
Sources: apps/web/middleware.ts:41-88
Partner programs and affiliate workflows
Partner Portal and Onboarding
Dub Partners empowers workspaces to establish, manage, and scale affiliate and referral programs Partner Programs. Workspaces that possess program management capabilities can initiate a new program from the workspace dashboard or via the DubPartnersPopup overlay Workspace Subscriptions. The partner portal UI surfaces network referral links, earnings summaries, and active referral tiers.
const { canManageProgram } = getPlanCapabilities(plan);
const [dismissed, setDismissed, { loading: loadingDismissed }] =
useWorkspaceStore<undefined | boolean>("dubPartnersPopupDismissed");
if (
// Loading
loadingWorkspace ||
loadingDismissed ||
// hide if workspace can't create a program
!canManageProgram ||
// hide if there's already a default program
defaultProgramId ||
// don't show on mobile
isMobile ||
// hide if already dismissed
dismissed
)
return null;
return (
<DubPartnersPopupInner
referenceElement={referenceElement}
onDismiss={() => setDismissed(true)}
/>
);
}Sources: apps/web/ui/layout/sidebar/dub-partners-popup.tsx:36-62
Prospective affiliates access network dashboards to track performance statistics and copy unique referral URLs Embeddable Referrals. If a partner's profile is not yet accepted into the network, a locked state view intercepts direct link generation and prompts the user to apply Partner Programs.
function ReferralLinkLocked() {
return (
<div className="rounded-xl border border-neutral-200 bg-white p-4">
<p className="text-content-default mb-2 text-sm font-semibold">
Network referral link
</p>
<div className="rounded-xl border border-neutral-200 p-2">
<div className="flex items-center justify-between gap-3">
<div className="flex min-w-0 flex-1 items-center gap-3">
<span
className="flex size-9 shrink-0 items-center justify-center rounded-full border border-neutral-200 bg-white sm:size-10"
aria-hidden
>
<Lock className="size-4 text-neutral-900" strokeWidth={2} />
</span>
<span className="text-content-default min-w-0 text-sm font-medium leading-snug">
Get accepted to the Dub Network to unlock
</span>
</div>
<Link href="/profile" className="shrink-0">
<Button text="Apply" variant="primary" className="h-9 w-fit px-4" />
</Link>
</div>
</div>
</div>
);
}Sources: apps/web/app/ee/partners.dub.co/dashboard/referrals/page.tsx:262-288
Note
Network referral links support deep-linking to any page on the partners domain by appending the ?via=username query parameter directly to the destination URL Conversion Tracking.
Sources: apps/web/app/ee/partners.dub.co/dashboard/referrals/page.tsx:350-370
Referral Link Construction and Embedded Dashboards
Affiliates construct customized links using utility helpers that combine group configurations and destination targets Embeddable Referrals. The ReferralsEmbedQuickstart component guides partners through sharing links, downloading program resources, and configuring payout methods Payout Settlement.
const items = [
{
title: "Share your link",
description: `Use your ${program.name} link to drive traffic and track every click, lead, and conversion.`,
illustration: <ShareLink />,
cta: (
<Button
className={BUTTON_CLASSNAME}
onClick={() => {
if (links.length > 0) {
copyToClipboard(
constructPartnerLink({
group,
link: links[0],
}),
);
} else {
setSelectedTab("Links");
}
}}
text={
links.length > 0
? copied
? "Copied link"
: "Copy link"
: "Create a link"
}
icon={
links.length > 0 ? (
<div className="relative size-4">
<div
className={cn(
"absolute inset-0 transition-[transform,opacity]",
copied && "translate-y-1 opacity-0",
)}
>
<Copy className="size-4" />
</div>
<div
className={cn(
"absolute inset-0 transition-[transform,opacity]",
!copied && "translate-y-1 opacity-0",
)}
>
<Check className="size-4" />
</div>
</div>
) : undefined
}
/>
),
},Sources: apps/web/app/ee/app.dub.co/embed/referrals/quickstart.tsx:37-88
Payout configuration checks whether the partner's country is supported by Tremendous or if a default payout method is already selected Payout Settlement. If earnings are equal to zero and no payout method is active, the interface disables withdrawal actions with a contextual tooltip Workspace Subscriptions.
{
title: "Receive earnings",
description:
"Connect payouts to get rewarded for the activity you drive, with earnings tracked automatically.",
illustration: <ConnectPayouts logo={group.logo ?? DUB_LOGO} />,
cta: (
<Button
className={
payoutsDisabled ? "h-9 rounded-lg" : BUTTON_CLASSNAME
}
disabledTooltip={
payoutsDisabled
? "You will be able to withdraw your earnings once you have made at least one sale."
: undefined
}
onClick={() => {
const isTremendousCountrySupported = Boolean(
!partner.country ||
TREMENDOUS_SUPPORTED_COUNTRIES.includes(partner.country),
);
// Show Tremendous payout settings if the partner already uses Tremendous for payouts,
// or hasn't selected a payout method yet and is eligible based on country.
const showTremendousSettings =
partner.defaultPayoutMethod === "tremendous" ||
(!partner.defaultPayoutMethod &&
isTremendousCountrySupported);
if (showTremendousSettings) {
setSelectedTab("Settings");
} else {
window.open("https://partners.dub.co/payouts", "_blank");
}
}}
text="Connect payouts"
/>
),
},
]),Sources: apps/web/app/ee/app.dub.co/embed/referrals/quickstart.tsx:122-159
| Quickstart Action Item | Target Condition | Call-to-Action Behavior |
|---|---|---|
| Share your link | links.length > 0 | Copies partner referral link to clipboard via constructPartnerLink |
| Share your link (empty) | links.length === 0 | Switches active embedded tab to "Links" to create a link |
| Program resources | hasResources === true | Navigates to "Resources" tab; disabled if assets are missing |
| Browse the FAQ | programEmbedData.hideEarnings | Navigates to "FAQ" tab for program guidance |
| Receive earnings | Default fallback | Opens Tremendous payout settings or external payout portal |
Sources: apps/web/app/ee/app.dub.co/embed/referrals/quickstart.tsx:43-158
Attribution, webhooks, and third-party integrations
Lead Attribution and Conversion Tracking
Conversion and lead attribution flow through client interactions captured by tracking helpers Conversion Tracking. When users authenticate, the trackDubLead utility inspects incoming request cookies for the dub_id click identifier and dispatches a lead tracking event to the Dub Node SDK instance Conversion Tracking.
export const trackDubLead = async (user: User) => {
const cookieStore = await cookies();
const clickId = cookieStore.get("dub_id")?.value;
if (!clickId) {
console.log("No dub_id cookie found, skipping lead tracking...");
return;
}
// send the lead event to Dub
await dub.track.lead({
clickId,
eventName: "Sign Up",
customerExternalId: user.id,
customerName: user.name,
customerEmail: user.email,
customerAvatar: user.image,
});Sources: apps/web/lib/auth/track-dub-lead.ts:5-22
Warning
If the dub_id cookie is missing from the cookie store during user registration, lead attribution is aborted entirely and tracking cleanup is skipped Conversion Tracking.
Sources: apps/web/lib/auth/track-dub-lead.ts:9-12
Customer objects can also be retrieved directly through the SDK client wrapper using their external database identifier with expanded field sets enabled REST API.
export const getDubCustomer = async (userId: string) => {
try {
const { result: customers } = await dub.customers.list({
externalId: userId,
includeExpandedFields: true,
});
return customers.length > 0 ? customers[0] : null;
} catch (error) {
console.error(error);
return null;
}
};Sources: apps/web/lib/dub.ts:6-18
Webhook Verification and Event Dispatch
Incoming webhooks are received at the /api/dub/webhook route, wrapped with Axiom logging, and validated against the Dub-Signature request header Webhooks & Postbacks. The route computes an HMAC SHA-256 hash using the request body and the local DUB_WEBHOOK_SECRET environment variable, validating integrity via timing-safe comparison Webhooks & Postbacks.
export const POST = withAxiom(async (req: Request) => {
const body = await req.json();
const { event, data } = webhookPayloadSchema.parse(body);
const webhookSignature = req.headers.get("Dub-Signature");
if (!webhookSignature) {
return new Response("No signature provided", { status: 401 });
}
const computedSignature = crypto
.createHmac("sha256", `${process.env.DUB_WEBHOOK_SECRET}`)
.update(JSON.stringify(body))
.digest("hex");
if (!timingSafeCompare(webhookSignature, computedSignature)) {
return new Response("Invalid signature", { status: 400 });
}Sources: apps/web/app/api/dub/webhook/route.ts:9-26
| Webhook Event | Handler Function | Trigger Condition |
|---|---|---|
lead.created | leadCreated(data) | New user signup via referral link Conversion Tracking |
sale.created | saleCreated(data) | New sale generated via referral link Commission Engine |
Sources: apps/web/app/api/dub/webhook/route.ts:30-37
Ecosystem Integrations and Client Configuration
The platform integrates with external services like HubSpot and Stripe through dedicated app packages HubSpot & Intercom. The HubSpot application metadata defines required CRM scopes and oauth callback endpoints OAuth Apps.
| HubSpot Scope Identifier | Access Level | Purpose |
|---|---|---|
oauth | Read/Write | Authentication and session setup |
crm.objects.contacts.read | Read | Fetch contact leads |
crm.objects.contacts.write | Write | Update contact data |
crm.objects.deals.read | Read | Track deal changes and values |
crm.schemas.contacts.write | Write | Manage custom contact properties |
Sources: packages/hubspot-app/src/app/app-hsmeta.json:14-20
Similarly, the Stripe app package exposes core client identifiers and host configurations to sync discount codes and customer transactions with Dub Stripe App.
export const DUB_CLIENT_ID =
"dub_app_517290377fe6b4dfcc8726a7061ba9b6da1c4d7d7d75f77a";
export const DUB_HOST = "https://app.dub.co";
export const DUB_API_HOST = "https://api.dub.co";Sources: packages/stripe-app/src/utils/constants.ts:2-5
Domain configuration and brand customization
Disabled Link and Error States
When short links are deactivated, expired, or flagged by safety checks, requests are routed to specialized error components like the disabled link handler. The DisabledLinkPage component renders a dedicated layout featuring a shield-slash icon, metadata configured to prevent search engine indexing, and standard UTM tracking parameters for downstream attribution Domain Management.
export const revalidate = false; // cache indefinitely
export const metadata = constructMetadata({
title: "Disabled Link",
description:
"This link has been disabled. Please contact the owner of this link to get a new one.",
noIndex: true,
});
const UTM_PARAMS = {
utm_source: "Disabled Link",
utm_medium: "Disabled Link Page",
};Sources: apps/web/app/domain/disabled/page.tsx:10-22
Note
The disabled link page explicitly sets revalidate = false to cache the static error representation indefinitely and defines an empty generateStaticParams array Domain Management.
Sources: apps/web/app/domain/disabled/page.tsx:10-11, apps/web/app/domain/disabled/page.tsx:24-26
Branded Call-to-Action and Placeholder Surfaces
Branded experiences across custom domains utilize shared placeholder components such as the CTA block Domain Management. This surface integrates platform ratings from external review platforms alongside dynamic UTM parameter construction for enterprise demo requests Domain Management.
| Review Platform | Badge Identifier | Rating Value | Destination URL |
|---|---|---|---|
| G2 | G2 | 5.0 | https://www.g2.com/products/dub/reviews |
| Product Hunt | Product Hunt | 5.0 | https://www.producthunt.com/products/dub |
| Trustpilot | Trustpilot | 4.5 | https://www.trustpilot.com/review/dub.co |
Sources: apps/web/ui/placeholders/cta.tsx:12-30
Links created through the call-to-action component automatically inherit campaign tags constructed from the active custom domain context Domain Management.
<ButtonLink
variant="secondary"
href={createHref("/enterprise", domain, {
utm_source: "Custom Domain",
utm_medium: "Welcome Page",
utm_campaign: domain,
utm_content: "Get a demo",
})}
>
Get a demo
</ButtonLink>Sources: apps/web/ui/placeholders/cta.tsx:108-118
Where to go next
| I want to… | Read |
|---|---|
| How do developers set up local development, run environment dependencies, migrate schemas, and seed test data? | Quick Start |
| How is the Turborepo monorepo organized across web apps, UI libraries, CLI utilities, email templates, and packages? | Project Structure |
| How does Next.js middleware direct multi-tenant requests across root domains, link redirects, admin consoles, and partner portals? | Request Routing |
| How is the database layer structured across Prisma ORM and PlanetScale, and how are relational models organized? | Database Architecture |
| How are session security, NextAuth credential handling, SAML SSO via BoxyHQ, and SCIM directory provisioning implemented? | Authentication |
| How are Redis caching, distributed locks, rate limiting, and real-time state managed with Upstash? | Caching & Rate Limiting |
| How does Dub resolve incoming short URLs into target destinations, apply geo-targeting, handle password protection, and proxy cloaked links? | Link Dispatch |
| How does Dub split traffic across destination URLs, evaluate variant rules, and determine experiment completion? | A/B Testing |
| How are customizable QR codes designed, rendered as SVGs and PNGs, and served via the QR engine? | QR Code Generator |
| How does Dub handle custom domain registration, DNS verification via Domain Connect, SSL issuance, and Dynadot registrar renewals? | Domain Management |
| How are dynamic Open Graph social images, avatars, and partner rewind banners rendered at the edge? | Dynamic Card Previews |
| How does Dub stream click and interaction telemetry into Tinybird Pipes and query aggregated analytics datasets? | Tinybird Analytics |
| How are web visits, lead submissions, and sale events captured, deduplicated, and attributed to specific links and partners? | Conversion Tracking |
| How does Dub query and render timeseries metrics, geolocations, devices, referrers, and export analytics CSV datasets? | Analytics Dashboard |
| How are administrative and workspace activity events recorded, retrieved, and exported for compliance tracking? | Audit Logs |
| How does Dub define, evaluate, and validate tiered percentage, flat-fee, and custom rewards for affiliates and referrers? | Reward Rules |
| How do prospective affiliates apply to programs, how are identity and platform credentials evaluated, and how are approvals managed? | Partner Programs |
| How are time-bound content challenges created, how do creators submit social media proofs, and how are metrics synced and reviewed? | Bounties & Submissions |
| How does Dub surface public affiliate programs, calculate program similarities, and handle partner discovery? | Program Marketplace |
| How does Dub manage workspace billing tiers, usage quotas, invoice lifecycle, and Stripe subscription webhooks? | Workspace Subscriptions |
| How are commissions calculated from sales, recurring subscriptions, refunds, and dispute adjustments? | Commission Engine |
| How are mature partner balances aggregated, split, and disbursed via Stripe Connect, PayPal, Tremendous gift cards, and stablecoins? | Payout Settlement |
| How does Dub flag suspicious click patterns, manage risk alerts, enforce commission hold periods, and verify identity via Veriff? | Fraud Prevention |
| How does the dedicated Stripe App package install into merchant dashboards and sync customer and discount code data with Dub? | Stripe App |
| How do the HubSpot and Intercom integrations synchronize contact leads and route live customer support messages? | HubSpot & Intercom |
| How does Dub upload offline conversions and attribution signals to Google Ads, Shopify Pixel, AppsFlyer, and Singular? | Ad Conversion Sync |
| How does Dub import links, customers, and commissions from Bitly, Rebrandly, Short.io, Rewardful, Tolt, FirstPromoter, and PartnerStack? | Data Importers |
| How does Dub act as an OAuth 2.0 authorization server to allow external client apps to request scopes and access tokens? | OAuth Apps |
| How are recurring routines for link expiration, domain renewal alerts, FX currency rate updates, and resource cleanups scheduled? | Scheduled Cron Tasks |
| How do asynchronous job queues and stream handlers process link-click webhooks, update workspace usage, and retry failed operations? | Queue Workers |
| How does Dub build React-email templates and dispatch transactional notifications and broadcast campaigns via Resend? | Email Notification |
| How are outgoing webhook deliveries and affiliate postback URLs signed, dispatched, and verified upon system events? | Webhooks & Postbacks |
| How does the admin portal handle internal moderation, user impersonation, domain registrar actions, and network oversight? | Admin Dashboard |
| How is the public OpenAPI specification defined, how are API keys authenticated, and how are core resources queried? | REST API |
| How do the embed-core and embed-react packages let third-party applications embed partner dashboards using signed tokens? | Embeddable Referrals |
| How does the Dub developer CLI package authenticate, interact with workspaces, and manage short links from the terminal? | CLI Tool |
Related
On This Page
OverviewPlatform scope and primary capabilitiesCore Product Modules and CapabilitiesMonorepo subsystems and application topologyArchitecture and Shared PackagesDeveloper Tooling and Marketplace ExtensionsEdge request processing and analyticsMiddleware Routing and Link ResolutionCaching and Telemetry StreamingPartner programs and affiliate workflowsPartner Portal and OnboardingReferral Link Construction and Embedded DashboardsAttribution, webhooks, and third-party integrationsLead Attribution and Conversion TrackingWebhook Verification and Event DispatchEcosystem Integrations and Client ConfigurationDomain configuration and brand customizationDisabled Link and Error StatesBranded Call-to-Action and Placeholder SurfacesWhere to go nextRelated