fixedlink

payload plugin

by fixedlink
Redirects & URLs
v3
v4
^3.0.0 || ^4.0.0
MIT

Overview

Summary generated from the README

Creates a short link through the FixedLink service for each document in the collections you configure. The link destination follows the document URL when the slug changes, while the short URL stays the same. It adds a sidebar panel to the admin and mounts authenticated endpoints so the API key stays on the server. Requires a FixedLink API key, which is a paid feature.

Features

  • Creates a short link on first save, pointing at a URL you define per collection
  • Updates the destination when the document URL changes without changing the short URL
  • Pauses the link when a document returns to draft and resolves it on publish
  • Sidebar panel with copy button, click stats and QR code
  • Configurable delete behavior: pause, delete or keep the link
  • Saves are never blocked if FixedLink is unreachable, with a retry button

Use cases

  • Give blog posts stable short links for print, email and social that survive slug edits
  • Track clicks on short links to published documents from inside the Payload admin
  • Publish documents on a custom short domain without manually managing redirects

From the author

Short links for Payload. Publish a document, get a link on your own domain that survives every slug change.

Installation

npm i @fixedlink/payload

1

Stars

0

Forks

0

Open Issues

3 months ago

Last Updated

8

Weekly Downloads

v0.1.0

npm Version

105.8 KB

Unpacked Size

1

Dependencies

GitHub stars

10 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 20261
Dec 5, 20261
Dec 4, 20261
Dec 3, 20261
Dec 2, 20261
Dec 1, 20261
Nov 30, 20261
Nov 29, 20261
Nov 28, 20261
Nov 27, 20261
Nov 26, 20261
Nov 25, 20261
Nov 24, 20261
Nov 23, 20261
Nov 22, 20261
Nov 21, 20261
Nov 20, 20261
Nov 19, 20261
Nov 18, 20261
Nov 17, 20261
Nov 16, 20261
Nov 15, 20261
Nov 14, 20261
Nov 13, 20261
Nov 12, 20261
Nov 11, 20261
Nov 10, 20261
Nov 9, 20261
Nov 8, 20261
Nov 7, 20261
Nov 6, 20261
Nov 5, 20261
Nov 4, 20261
Nov 3, 20261
Nov 2, 20261
Nov 1, 20261
Oct 31, 20261
Oct 30, 20261
Oct 29, 20261
Oct 28, 20261
Oct 27, 20261
Oct 26, 20261
Oct 25, 20261
Oct 24, 20261
Oct 23, 20261
Oct 22, 20261
Oct 21, 20261
Oct 20, 20261
Oct 19, 20261
Oct 18, 20261
Oct 17, 20261
Oct 16, 20261
Oct 15, 20261
Oct 14, 20261
Oct 13, 20261
Oct 12, 20261
Oct 11, 20261
Oct 10, 20261
Oct 9, 20261
Oct 8, 20261
Oct 7, 20261
Oct 6, 20261
Oct 5, 20261
Oct 4, 20261
Oct 3, 20261
Oct 2, 20261
Oct 1, 20261
Sep 30, 20261
Sep 29, 20261
Sep 28, 20261
Sep 27, 20261
Sep 26, 20261
Sep 25, 20261
Sep 24, 20261
Sep 23, 20261
Sep 22, 20261
Sep 21, 20261
Sep 20, 20261
Sep 19, 20261
Sep 18, 20261
Sep 17, 20261
Sep 16, 20261
Sep 15, 20261
Sep 14, 20261
Sep 13, 20261
Sep 12, 20261
Sep 11, 20261
Sep 10, 20261
Sep 9, 20261
Sep 8, 20261
Sep 7, 20261
npm weekly downloads

7−1 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 20267
Dec 5, 20267
Dec 4, 202610
Dec 3, 20269
Dec 2, 20268
Dec 1, 20268
Nov 30, 20268
Nov 29, 20268
Nov 28, 20266
Nov 27, 20263
Nov 26, 20262
Nov 25, 20262
Nov 24, 20262
Nov 23, 20262
Nov 22, 20263
Nov 21, 20263
Nov 20, 20264
Nov 19, 20265
Nov 18, 20265
Nov 17, 20264
Nov 16, 20265
Nov 15, 20264
Nov 14, 20264
Nov 13, 20267
Nov 12, 20266
Nov 11, 20266
Nov 10, 20265
Nov 9, 20265
Nov 8, 20266
Nov 7, 20267
Nov 6, 20266
Nov 5, 20267
Nov 4, 20267
Nov 3, 20267
Nov 2, 202610
Nov 1, 202610
Oct 31, 202610
Oct 30, 20267
Oct 29, 20266
Oct 28, 20266
Oct 27, 20268
Oct 26, 20264
Oct 25, 20265
Oct 24, 20264
Oct 23, 20264
Oct 22, 20268
Oct 21, 202610
Oct 20, 20268
Oct 19, 20268
Oct 18, 20266
Oct 17, 20268
Oct 16, 20269
Oct 15, 20266
Oct 14, 20264
Oct 13, 20264
Oct 12, 20265
Oct 11, 20266
Oct 10, 20266
Oct 9, 20265
Oct 8, 20265
Oct 7, 20266
Oct 6, 20267
Oct 5, 20267
Oct 4, 20267
Oct 3, 20265
Oct 2, 20265
Oct 1, 20264
Sep 30, 20263
Sep 29, 20263
Sep 28, 20262
Sep 27, 20262
Sep 26, 20268
Sep 25, 20269
Sep 24, 20269
Sep 23, 202610
Sep 22, 20269
Sep 21, 202610
Sep 20, 20269
Sep 19, 20263
Sep 18, 20263
Sep 17, 20264
Sep 16, 20264
Sep 15, 20265
Sep 14, 20264
Sep 13, 20265
Sep 12, 20265
Sep 11, 20265
Sep 10, 20264
Sep 9, 20265
Sep 8, 20265
Sep 7, 20268

Each point is npm's rolling 7-day download count.

Health Score

51/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1338986397-root.svg)](https://payloaddirectory.dev/plugins/1338986397-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1338986397-root"><img src="https://payloaddirectory.dev/badge/1338986397-root.svg" alt="Payload Directory"></a>
Updated Aug 21, 2026Created Aug 19, 2026Published Aug 21, 2026

README

@fixedlink/payload

Short links for Payload, backed by FixedLink.

Publish a document and it gets a short link on your own domain. Change the slug six months later and the short link still works, because the plugin moves it with the document. That is the whole idea.

pnpm add @fixedlink/payload

Setting it up

import { buildConfig } from 'payload'
import { fixedLinkPlugin } from '@fixedlink/payload'

export default buildConfig({
  plugins: [
    fixedLinkPlugin({
      apiKey: process.env.FIXEDLINK_API_KEY!,
      collections: [
        {
          collection: 'posts',
          url: ({ doc }) => `https://acme.com/blog/${doc.slug}`,
          tags: ['blog'],
        },
      ],
    }),
  ],
})

url is the only part you have to write. Payload has no idea what a document's public address is, so you say, and returning null leaves that document out.

Get an API key from Dashboard, Settings, API. It is shown once. API access is a paid feature.

What an editor sees

A Short link panel in the sidebar. The link itself with a copy button, clicks over the last week, month, quarter or year, and the QR code behind a toggle. Below it, the domain to publish on and a checkbox for documents that should not have a short link at all.

Nothing in that panel talks to FixedLink directly. The API key is a server secret, and an admin bundle is a browser bundle, so the sidebar reads through four endpoints this plugin mounts. Each one refuses anybody who is not signed in to Payload.

What it does on save

WhenWhat happens
First savea link is created, pointing at url(...)
The URL changesthe link's destination follows it, the short URL does not change
Publishedthe link resolves
Back to draftthe link is paused
Deletedthe link is paused, kept, or deleted, your choice

A save is never blocked. If FixedLink is unreachable the document still saves, the failure is logged, and the sidebar offers a button that tries again. An article should not be refused because a link shortener is having a bad day.

Nothing is written when neither the destination nor the status changed, so a typo fix does not cost an API call.

Options

apiKeyrequiredAn API key. Keep it in an env var.
collectionsrequiredWhich collections get links, and where they point.
baseUrlhttps://fixed.linkOnly worth setting for a self-hosted instance.
enabledtrueTurn it off without uninstalling. The fields stay, so nothing is lost.
fieldNamefixedlinkName of the group added to each synced collection.
onDeletepausepause, delete or keep.
routePrefix/fixedlinkWhere the admin endpoints are mounted.

Per collection:

collectionrequiredThe slug.
urlrequired({ collection, doc, req }) => string | null.
tagsApplied to every link the collection creates.
monitorWatch the destination and email when it stops answering.
domainIdDefault custom domain. The editor can pick a different one.

Two things to know

The domain is fixed once the link exists. PATCH /links/{id} cannot move a link between domains, so the picker goes read-only after the first save. Pick the domain before you publish, or make a new link.

Deleting a document pauses its link. A short link outlives the page it was made for. It is on a poster, in an email that was already sent, in somebody's bookmarks. Pausing keeps it recoverable. Set onDelete: 'delete' if you would rather it were gone.

Contributing

pnpm install
pnpm test
pnpm typecheck
pnpm build

main and exports point at dist, so build before anything consumes the package. pnpm build is fast and pnpm test does not need it.

Until @fixedlink/api-client is on npm, add an override to pnpm-workspace.yaml pointing at a build of it:

cd ../fixedlink/packages/api-client && pnpm build && pnpm pack \
  --pack-destination ../../../fixedlink-payload/.pkg
cd ../../../fixedlink-payload
mkdir -p .pkg/api-client && tar -xzf .pkg/fixedlink-api-client-0.1.0.tgz \
  -C .pkg/api-client --strip-components=1
overrides:
  '@fixedlink/api-client': link:./.pkg/api-client

Leave that out of any commit. CI installs from the registry.

There is a Payload app to try it in at ../fixedlink-payload-dev, which is not in any repo.

MIT.

Similar plugins