The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
###############################
###### REQUIRED ENV VARS ######
###############################
# Generate secrets with: node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
NEXTAUTH_SECRET=
NEXTAUTH_URL=http://localhost:8888 # (only needed for localhost)
# Secret for Vercel cron jobs + sync-embeddings
CRON_SECRET=
# Encryption key (AES-256-GCM) for encrypting sensitive data in the database
ENCRYPTION_KEY=
# Email unsubscribe token secret (optional, falls back to NEXTAUTH_SECRET)
UNSUBSCRIBE_TOKEN_SECRET=
# MySQL Database via Planetscale
# Get your MySQL Database URL here: https://planetscale.com/docs/tutorials/connect-nodejs-app
DATABASE_URL="mysql://root:@localhost:3306/planetscale"
# Set local development documentation for connecting to a local database: https://dub.co/docs/local-development#step-4-set-up-planetscale-mysql-database
PLANETSCALE_DATABASE_URL="http://root:unused@localhost:3900/planetscale"
# Upstash Redis – required for Redis caching
# Get your Redis REST URL and Token here: https://upstash.com/docs/redis/overall/getstarted
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
# Upstash QStash – required for queues and background jobs
# Get your QStash Token here: https://upstash.com/docs/qstash/overall/getstarted
QSTASH_URL="https://qstash-us-east-1.upstash.io"
QSTASH_TOKEN=
QSTASH_CURRENT_SIGNING_KEY=
QSTASH_NEXT_SIGNING_KEY=
# Tinybird – required for analytics
# Get your Tinybird Auth Token here: https://www.tinybird.co/docs/concepts/auth-tokens.html
TINYBIRD_API_KEY=
# Varies based on your Tinybird region: https://www.tinybird.co/docs/api-reference/api-reference.html#regions-and-endpoints
TINYBIRD_API_URL=https://api.tinybird.co
# Vercel's Domains API – required for adding and removing domains
# Learn how to set this up: https://vercel.com/templates/next.js/domains-api
TEAM_ID_VERCEL=
VERCEL_API_KEY=
# Required for email login
# Get your Resend API Key here: https://resend.com/api-keys
RESEND_API_KEY=
# SMTP configuration (Recommended for local development)
SMTP_HOST=localhost
SMTP_PORT=1025
SMTP_USER=smtpUser
SMTP_PASSWORD=smtpPassword
###############################
###### OPTIONAL ENV VARS ######
###############################
# Stripe – used for subscriptions
# If you don't need this, you can also remove the `lib/stripe` folder and all instances of `stripe` from the codebase
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
# Stripe Integration
STRIPE_APP_WEBHOOK_SECRET=
STRIPE_APP_SECRET_KEY=
STRIPE_APP_SECRET_KEY_TEST=
STRIPE_APP_SECRET_KEY_SANDBOX=
# Shopify App webhook events
SHOPIFY_WEBHOOK_SECRET=
# Used for Google Login
# Learn how to set this up here: https://next-auth.js.org/providers/google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Used for GitHub Login
# Learn how to set this up here: https://next-auth.js.org/providers/github
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Edge Config – used for admin features like banning users, rate limiting etc.
# Create one here: https://vercel.com/docs/storage/edge-config
# Alternatively, if you don't need this, you can also remove `lib/edge-config.ts`
# and all instances of `EDGE_CONFIG` and `EDGE_CONFIG_ID` from the codebase
EDGE_CONFIG=
EDGE_CONFIG_ID=
# Bitly Importer: https://dub.co/blog/migration-assistants
# Apply for an API key here: https://dev.bitly.com/
BITLY_CLIENT_ID=
BITLY_CLIENT_SECRET=
# Used for Custom Link Previews feature
# Apply for an API key here: https://unsplash.com/developers
UNSPLASH_ACCESS_KEY=
# Use for storing image assets
STORAGE_ACCESS_KEY_ID=
STORAGE_SECRET_ACCESS_KEY=
STORAGE_ENDPOINT=
STORAGE_BASE_URL=
STORAGE_PUBLIC_BUCKET=
STORAGE_PRIVATE_BUCKET=
# Shared secret for Cloudflare Workers that call Next.js webhooks
CLOUDFLARE_WORKER_WEBHOOK_SECRET=
# Used for internal monitoring & paging
# You can remove this by removing `DUB_SLACK_HOOK_CRON` and `DUB_SLACK_HOOK_LINKS` from the codebase
DUB_SLACK_HOOK_CRON=
DUB_SLACK_HOOK_LINKS=
# Slack Dub Support integration
DUB_SLACK_ASSISTANT_BOT_TOKEN=
# Used for background jobs
# Get your ngrok URL here: https://ngrok.com/
NEXT_PUBLIC_NGROK_URL=
# For AI features
AI_GATEWAY_API_KEY=
ANTHROPIC_API_KEY=
# Axiom – used for logging and monitoring
# Get your Axiom token here: https://axiom.co/docs/rest-api/authentication
AXIOM_TOKEN=
AXIOM_DATASET=
# Plain – used for customer support integration
# Get your Plain API key here: https://www.plain.com/docs/api
PLAIN_API_KEY=
PLAIN_WEBHOOK_SECRET=
######################################
###### DUB.CO INTERNAL USE ONLY ######
######################################
# Docs / help center search index
UPSTASH_VECTOR_REST_URL=
UPSTASH_VECTOR_REST_TOKEN=
# Slack integration
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_SIGNING_SECRET=
# Dynadot API key for domain registration
DYNADOT_API_KEY=
DYNADOT_BASE_URL=
DYNADOT_COUPON=
# Analytics script installation verification
FIRECRAWL_API_KEY=
# for generating planetscale backups (https://planetscale.com/docs/api/service-tokens)
PLANETSCALE_SERVICE_TOKEN=
# Hubspot integration
HUBSPOT_CLIENT_ID=
HUBSPOT_CLIENT_SECRET=
# Google Ads integration
GOOGLE_ADS_CLIENT_ID=
GOOGLE_ADS_CLIENT_SECRET=
GOOGLE_ADS_DEVELOPER_TOKEN=
# Domain Connect (auto-configure DNS for custom domains)
# Generate key: openssl genrsa -out private.pem 2048
# Get public key: openssl rsa -in private.pem -pubout -outform DER | base64 | tr -d '\n'
DOMAIN_CONNECT_PRIVATE_KEY=