npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mrtimmy/payload-connector

v0.2.1

Published

Payload CMS connector for publishing mr.timmy blog posts.

Readme

mr.timmy Payload Connector

Payload CMS connector for publishing blog posts from mr.timmy.

Installation

pnpm add @mrtimmy/payload-connector

Add the plugin to payload.config.ts:

import { buildConfig } from "payload"
import { mrTimmyPayloadConnector } from "@mrtimmy/payload-connector"

export default buildConfig({
  plugins: [
    mrTimmyPayloadConnector({
      postsCollection: "posts",
      taxonomies: {
        categories: { matchFields: ["slug", "title"] },
        tags: { matchFields: ["slug", "title"] },
      },
    }),
  ],
})

Deploy the Payload site after changing the config.

If your Payload app runs inside Next.js and external packages are bundled too aggressively, keep the connector external in next.config.js:

const nextConfig = {
  serverExternalPackages: ["@mrtimmy/payload-connector"],
}

export default nextConfig

Create a Connector Key

After deployment, open the Payload admin panel:

  1. Go to mr.timmy -> Connector Keys.
  2. Create a new key.
  3. Copy the API URL and API key into mr.timmy under Deine Kanäle -> Payload CMS.

The default API URL is:

https://your-domain.com/api/mrtimmy/create-post

Endpoints

The plugin exposes:

GET  /api/mrtimmy/create-post
POST /api/mrtimmy/create-post
POST /api/mrtimmy/create-post/:id/publish

Requests must include:

x-api-key: timmy_xxx

X-MarketingAI-Key is also accepted for compatibility with the WordPress connector naming.

Options

mrTimmyPayloadConnector({
  postsCollection: "posts",
  contentMode: "lexical",
  media: {
    collection: "media",
    uploadFeaturedImage: true,
    uploadInlineImages: true,
  },
  fields: {
    title: "title",
    content: "content",
    excerpt: "excerpt",
    slug: "slug",
    status: "_status",
    metaTitle: "meta.title",
    metaDescription: "meta.description",
    focusKeyword: "focusKeyword",
    featuredImageUrl: "featuredImage",
    imageAlt: "imageAlt",
    contentAssets: "contentAssets",
    categories: "categories",
    tags: "tags",
  },
  taxonomies: {
    categories: {
      collection: "categories",
      create: true,
      matchFields: ["slug", "title"],
    },
    tags: {
      collection: "tags",
      create: true,
      matchFields: ["slug", "title"],
    },
  },
})

contentMode can be:

  • lexical (default): converts Markdown to HTML and then to Payload Lexical JSON.
  • html: converts Markdown to HTML.
  • markdown: stores Markdown as plain text.

If your Payload post schema uses different field names, override fields.

Media Uploads

If the configured featuredImageUrl field points to a Payload upload field, the connector downloads the incoming image URL, uploads it to the configured media collection, and stores the new media document ID on the post.

mrTimmyPayloadConnector({
  media: {
    collection: "media",
    fields: {
      alt: "alt",
      title: "title",
    },
  },
  fields: {
    featuredImageUrl: "featuredImage",
  },
})

If featuredImageUrl is a plain text/URL field, the connector keeps the old behavior and stores the image URL instead.

Inline Markdown images in the article body are also uploaded to the media collection when possible. Their URLs are rewritten before the content is converted to HTML or Lexical JSON.

To disable media handling:

mrTimmyPayloadConnector({
  media: false,
})

Categories and Tags

The connector accepts category/tag input from fields like categories, categoryNames, categorySlugs, tags, tagNames, and tagSlugs.

If the target Payload fields are relationship fields, the connector looks up matching documents by slug or title. Missing terms are created by default. Configured matchFields that do not exist in the target Payload collection are ignored.

mrTimmyPayloadConnector({
  fields: {
    categories: "categories",
    tags: "tags",
  },
  taxonomies: {
    categories: {
      collection: "categories",
      labelField: "title",
      slugField: "slug",
      matchFields: ["slug", "title"],
      create: true,
    },
    tags: {
      collection: "tags",
      labelField: "title",
      slugField: "slug",
      matchFields: ["slug", "title"],
      create: true,
    },
  },
})

If your taxonomy collections use another required field, provide createData.

Notes

  • The plugin uses Payload Custom Endpoints and Payload Local API.
  • Custom endpoints are authenticated by this plugin, not by Payload automatically.
  • Draft/publish defaults to _status: "draft" | "published", matching Payload draft-enabled collections.
  • If your collection does not use drafts or uses a custom status field, configure fields.status and statuses, or set fields.status to null.
  • Uploads use Payload's Local API with filePath; hooks and storage adapters on your media collection still run.
  • Connector errors include the failing step (RichText-Konvertierung, Taxonomie-Mapping, Media-Upload or Payload-Create) so mr.timmy can show a useful error instead of a generic Payload failure.