Integrates Payload with Dub, either or a self-hosted instance, so published documents automatically get a shortlink, tag and color. It adds collections for links, tags and analytics, and per-collection options for slug override. Requires a Dub API key and a site URL, and targets Payload v4, with a separate release line for v3.
A Payload CMS plugin that integrates with Dub to automatically create and manage shortlinks for your content.
Installation
npm i @rubixstudios/payload-dub4
Stars
0
Forks
0
Open Issues
Yesterday
Last Updated
0
Weekly Downloads
v2.0.2
npm Version
91.1 KB
Unpacked Size
2
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1078131883-root)<a href="https://payloaddirectory.dev/plugins/1078131883-root"><img src="https://payloaddirectory.dev/badge/1078131883-root.svg" alt="Payload Directory"></a>README
A Payload CMS plugin that integrates with Dub to automatically create and manage shortlinks for your content. This plugin synchronizes your Payload collections with Dub.co, ensuring that every published document gets a corresponding shortlink, tag, and color configuration.
Dub is the modern, open-source link attribution platform for short links, conversion tracking, and affiliate programs.
Create a free Dub account: Dub
The plugin maintains two release lines, with Payload CMS v4 as the primary release and Payload CMS v3 maintained separately.
| Payload CMS | Plugin version | Release branch | npm dist-tag |
|---|---|---|---|
| v4 | 2.x | main | latest |
| v3 | 1.x | payload-v3 | payload-v3 |
Install the release matching your Payload version. The latest tag targets Payload v4 after the v4 release is published.
pnpm add @rubixstudios/payload-dub
// payload.config.ts
import { buildConfig } from 'payload/config'
import { payloadDub } from '@rubixstudios/payload-dub'
export default buildConfig({
plugins: [
payloadDub({
baseUrl: process.env.DUB_BASE_URL, // Optional: self hosted Dub url
collections: [
{ docs: 'posts', slugOverride: 'post' }, // Custom slug used for folder and shortlinks
{ docs: 'insights', slugOverride: 'insight' }, // Custom slug only
{ docs: 'news' }, // Default behavior
],
dubApiKey: process.env.DUB_API_KEY!,
siteUrl: process.env.NEXT_PUBLIC_SITE_URL!,
domain: 'mycustomdomain.com', // Optional: assign a custom domain
tenantId: '12345', // Optional: tenant identifier for workspace
isPro: false, // Optional: pro flag to enable/disable pro features
// Optional: overrides of dubCollection
dubCollection: {
overrides: {
access: {
read: ({ req }) => !!req.user,
create: ({ req }) => !!req.user,
},
admin: {
group: 'Marketing',
defaultColumns: ['shortLink', 'externalId'],
},
},
},
dubTagCollection: {
overrides: {
access: {
read: ({ req }) => !!req.user,
},
admin: {
group: 'Marketing',
defaultColumns: ['name', 'color'],
},
},
},
dubAnalytics: {
overrides: {
access: {
read: ({ req }) => !!req.user,
},
admin: {
group: 'Marketing',
},
},
},
}),
],
})
If you do not provide optional overrides, the plugin defaults to:
This project is licensed under the MIT License - see the LICENSE file for details.
For support or inquiries:
Rubix Studios
https://rubixstudios.com.au
Topics
redirects
Manage internal and external redirects from a dedicated collection in the Payload admin panel
100105.3k/wk45.4kv3
payload plugin netlify deploy
Publish button in the Payload admin that builds a Netlify site, streams the log and publishes a preview
6720/wk29v3
payload plugin deskcrew
Turn new documents in chosen collections into DeskCrew support tickets
654/wk0v2
payload isr
Revalidate Next.js paths and cache tags when Payload documents change, with optional full rebuild fallback
650/wk3v3
sitemap
Chunked, lazily cached XML sitemaps with hook-driven invalidation and robots.txt helpers
6123/wk15v3
payload seo analyzer
Offline on-page SEO analysis, admin dashboard, sitemaps and JSON-LD for Payload 3 and Next.js
600/wk16v3