@forumone/throughline

中文文档
2.7.1发布于 2026/11/11MITTypeScriptES Module构建来源已验证近 30 天下载 2213

Throughline: an editorial platform for Payload CMS. Publishing, approvals, audit, integrations, email and jobs, with every feature reachable over MCP.

原始使用文档
文档目录3 节
  1. What's inside
  2. throughline()
  3. Installation

@forumone/throughline

Throughline for Payload CMS: publishing behind a policy pipeline, approvals, the audit log, editorial reports, integrations, email and background jobs, with every feature reachable over MCP. One call registers the suite; each part also lives on its own subpath.

Coming from 0.x? This package is core, plugin-contract, publishing, workflows, audit, approvals, components, integrations and email together. Upgrading from 0.x moves a 0.x site onto it, with a codemod for the imports.

Reference: docs/reference/throughline.md, with a page per plugin.

What's inside

SubpathHolds
(root)assertEnvironment, checkEnvValue, hardenCoreCollections, mcpApiKeyAccess, withMeta, auditContext, the logger, utilities, and the plugin types
/publishingpublishingPlugin, the publishing service, isDraftWrite, the accessibility checks, and the revalidation and scheduled-publishing jobs; see publishing
/editorialeditorialPlugin: content health, the content calendar, "Your work", command palette search, and their MCP tools
/approvalsapprovalsPlugin, signed action links, expireStaleApprovalsJob; see approvals
/auditauditPlugin, getAuditWriter, AUDIT_ACTIONS, auditQueryPlugin and its tools, auditEventEchoJob; see audit
/componentscomponentsPlugin: the design-system manifest over MCP; see components
/integrationsintegrationsPlugin, the registry, the webhook integration, manual sync, healthcheckJob; see integrations
/emailemailPlugin, the Resend client, the approval notifications and their templates; see email
/jobsdefineJob, the job types, the failure handlers, and CoreEvents for module augmentation; see jobs
/jobs/inngestinngestJobs, createInngestClient, resolveInngestEnv, registrableInngestFunctions
/jobs/payloadpayloadJobs
/mediaBlob client-upload hardening, and reference tracking: referencesPlugin, findReferences, the delete and trash guards
/fieldsThe field kit: slugField, publishingFields, revisedAtField, unlistedField, characterCountPlugin, fieldsPlugin
/observabilityjobFailuresPlugin, getJobFailureWriter, createErrorReporter, reportError, buildRequestErrorReport
/testingdescribeAnonymousAccess, checkAnonymousAccess: test helpers for a site
/cache-tagscreateCacheTags, which imports nothing, for front-end readers
/linksmarkLinkTarget, LINK_TARGET_KEY and linkTargetMarker. This is the link-target marker. It imports nothing, so a link-field helper that a client component also imports can use it
/client, /rscThe admin's client and server components, named in Payload's import map
binthroughline migrate-imports, see Upgrading from 0.x; throughline-payload, see the reference

throughline()

// payload.config.ts
import { mcpApiKeyAccess, throughline } from '@forumone/throughline'
import { inngestJobs } from '@forumone/throughline/jobs/inngest'

export const suite = throughline({
  jobs: inngestJobs(inngest), // or payloadJobs() from /jobs/payload
  collections: ['pages', 'posts'],
  publishing: { urls: { pages: (slug) => `/${slug}`, posts: (slug) => `/blog/${slug}` } },
  approvals: { groups, groupResolver },
  email: { resolveApprover, resolveRequester },
  integrations: {},
  healthcheck: { checks: [createPayloadReachableCheck()] },
})

export default buildConfig({
  // …
  plugins: [
    suite.plugin,
    mcpPlugin({
      mcp: { tools: suite.mcpTools },
      overrideApiKeyCollection: mcpApiKeyAccess(isAdmin),
    }),
  ],
})
// app/api/inngest/route.ts, on Inngest. On Payload Jobs, suite.plugin registers the jobs itself.
const jobs = inngestJobs(inngest, { onFailure: createTerminalFailureHandler({ payload }), payload })
export const { GET, POST, PUT } = serve({ client: inngest, functions: jobs.functions(suite.jobs) })
  • It registers every plugin in the order they need. Audit, job failures and check_slug are always on. Every other plugin is on when its key is present.
  • It gives every plugin the one MCP collector. suite.mcpTools is what mcpPlugin serves.
  • Shared values are given once. approvals.collectionSlug reaches the approvals collection, the emails and the expiry job. collections reaches publishing, "Your work" and scheduled publishing. admin is every added collection's sidebar group, unless a plugin's own says otherwise.
  • suite.jobs is every job the options call for: revalidation (given publishing.urls), scheduled publishing and its backstop, approval expiry, the audit echo, the healthcheck, the three approval emails, and each integration's jobs. Function ids are the ones the 0.x factories registered.
  • Its defaults are what every site wrote by hand. Scheduled publishes go through the publishing pipeline. Approval links are signed with APPROVAL_TOKEN_SECRET against NEXT_PUBLIC_SERVER_URL. A failing healthcheck is recorded in job-failures.

The reasoning is in 1.0-throughline-call.md. Each plugin is still exported from its subpath for a site that wires them by hand.

Installation

pnpm add @forumone/throughline

payload@^3.89.0 is the one required peer. The rest are optional, each needed only by the subpaths that use it, and none is loaded by the root:

InstallWhen the site uses
inngest/jobs/inngest: jobs on Inngest
resend, @react-email/components, @react-email/render, react/email, or email in throughline(). Loaded when an email is sent, so a missing one says so then, naming the package
next, react, @payloadcms/ui, @payloadcms/next/client and /rsc, which Payload's admin imports
@vercel/blob, @payloadcms/plugin-cloud-storage/media's client-upload hardening
vitest/testing

src/peers.test.ts checks the table: a static import that would load an optional peer from somewhere else fails it.

Every option, the jobs suite.jobs holds, the audit log, MCP authentication, the environment check and the throughline-payload bin are in the reference.

版本与发布记录

@forumone/throughline 共发布 106 个版本,首次发布于 2026/10/03;过去 12 个月发布了 106 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.7.1latest2026/11/114 天前
2.7.1-next-ffd51b1next2026/11/0213 天前
2.7.1-next-4a4ebd52026/10/2719 天前
2.7.1-next-2fec9f62026/10/2620 天前
2.7.1-next-1eabdf72026/10/2126 天前
2.7.1-pr-332-911b986pr2026/10/2126 天前

关于 @forumone/throughline 的常见问题

@forumone/throughline 是什么?

Throughline: an editorial platform for Payload CMS. Publishing, approvals, audit, integrations, email and jobs, with every feature reachable over MCP.

如何安装 @forumone/throughline?

在项目目录运行 npm install @forumone/throughline,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:payload(^3.89.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 throughline、throughline-payload,可以用 npx throughline 直接运行。

@forumone/throughline 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@forumone/throughline 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@forumone/throughline 可以商用吗?

@forumone/throughline 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@forumone/throughline 的下载量有多少?

根据 npm 官方下载统计,@forumone/throughline 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,213 次,日均约 74 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@forumone/throughline 还在维护吗?

最新版本 2.7.1 发布于 2026/11/11(4 天前);至今共发布 106 个版本,其中过去 12 个月发布了 106 个;首次发布于 2026/10/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。