@crvouga/mockingbird-service-meta

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

Meta的转换和营销 API 的状态仿真器:服务器事件,去重复,活动对象,透视,平面和图形错误信封.

中文使用文档
文档目录6 节
  1. 安装
  2. 使用量
  3. 路线
  4. 管理和缺陷
  5. API 密码
  6. 故意不模拟

@crvouga/mockingbird-service-meta (英语)

本地模拟器。 真正的API合同. 部分 嘲笑鸟。 。 。 .

Stateful Meta Graph v26 服务器侧转换的模拟器 API 事件和营销报告. 这个 保存隐私安全的散列用户字段,事件分解,模糊的写作,图错误, 运动对象, 过时的洞察力, 崩溃, 和光标平面图, 不联系Meta.

安装

npm install -D @crvouga/mockingbird-service-meta

仅限无害环境管理。 节点 22或 Bun 1.2. 服务 npx mockingbird-meta serve, (中文(简体) ), createServer 从 ./server,或挂载 createRuntime() 在任何兼容的获取程序中.

使用量

使图形来源可以注入,并将其指向模拟器。 任何非空合成相机标志或 access_token 查询值认证, 除非 /__admin/settings 限制标志.

import { createServer } from "@crvouga/mockingbird-service-meta/server"

const server = await createServer()

// The application's own Conversions API request. Only the Graph origin changes:
// server.url instead of https://graph.facebook.com.
const response = await fetch(`${server.url}/v26.0/pixel_test/events`, {
  method: "POST",
  headers: { authorization: "Bearer meta_test", "content-type": "application/json" },
  body: JSON.stringify({ data: [{
    event_name: "Purchase",
    event_time: Math.floor(Date.now() / 1000),
    event_id: "order_42",
    action_source: "website",
    user_data: { em: ["a".repeat(64)] },
    custom_data: { currency: "USD", value: 42 },
  }] }),
})
console.log(await response.json())
// → {events_received: 1, messages: [], fbtrace_id: "trace_…"}

await server.close()

路线

路线行为
POST /v26.0/:pixelId/events接受 CAPI 请求 data[] 财务报告和审定财务报表 test_event_code;保留事件名称/时间/id,动作源,源 URL,散列用户数据和自定义数据. 重复 event_id 数值在没有第二个存储事件的情况下被确认。 超过7天的事件,未来的事件,畸形散列和无效的天体都会收到Graph错误信封.
GET /v26.0/:accountId/insights由包含 JSON 的种子或管理员插入的洞察行过滤器 time_range,带有 limit编号 :after,包括 country 被请求作为细目.
GET /v26.0/:objectId读取种子/admin-插入运动,广告设置,或广告记录.

种子固定装置是 act_mockingbird, (中文(简体) ), cmp_mockingbird, (中文(简体) ), set_mockingbird,以及 ad_mockingbird, (中文(简体) ), 其中有从2026-01-01到2026-01-03的三道相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相距相.

管理和缺陷

GET /__admin/events 返回名称空间的隐私安全存储请求. GET/PUT /__admin/settings 控件 accessTokens 财务报告和审定财务报表 maxEventAgeSeconds标准 /__admin/state 路径种子或编辑 events, (中文(简体) ), objects,以及 insights 直接说.

预设 : expired_token, (中文(简体) ), rate_limited, (中文(简体) ), server_error, (中文(简体) ), partial_event_acceptance, (中文(简体) ), accepted_then_drop,以及 slow。模糊的写法预设会持续到事件结束 连接; 重试相同的 event_id 现仍为复式.

使用命名空间 x-mockingbird-namespace, (中文(简体) ), /__admin/ns/<name>/…,或证书绘图 PUT /__admin/credentials。 。 。 .

API 密码

主要出口 MetaAPI, (中文(简体) ), MetaState, (中文(简体) ), createRuntime, (中文(简体) ), META_NAMESPACE, (中文(简体) ), META_PRESETS, (中文(简体) ), DEFAULT_SETTINGS, (中文(简体) ), accessTokenCredential,生成 document, (中文(简体) ), operationIds, (中文(简体) ), supportedOperationIds,及其公共选项/状态/活动/视觉类型. @crvouga/mockingbird-service-meta/server 出口 createServer, (中文(简体) ), serveTarget, (中文(简体) ), DEFAULT_PORT,以及服务器选项/结果类型.

故意不模拟

  • 真正的广告投递,归属计算,散列平原PII,app-secret proof,或OAuth.
  • 运动/ad-set/ad突变,创意,受众,像素配置,仪表板,或计费.
  • 完整的透视字段/分解矩阵和同步报告任务.
  • Meta-side概率匹配:模拟器只记录所提供的合成散列场.

版本与发布记录

@crvouga/mockingbird-service-meta 共发布 23 个版本,首次发布于 2026/10/05;过去 12 个月发布了 23 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.11.0latest2026/11/11今天
1.10.92026/11/038 天前
1.10.82026/11/038 天前
1.10.72026/11/038 天前
1.10.62026/11/038 天前
1.10.52026/11/038 天前

关于 @crvouga/mockingbird-service-meta 的常见问题

@crvouga/mockingbird-service-meta 是什么?

Meta的转换和营销 API 的状态仿真器:服务器事件,去重复,活动对象,透视,平面和图形错误信封.

如何安装 @crvouga/mockingbird-service-meta?

在项目目录运行 npm install @crvouga/mockingbird-service-meta,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mockingbird-meta,可以用 npx mockingbird-meta 直接运行。

@crvouga/mockingbird-service-meta 支持 TypeScript 吗?

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

@crvouga/mockingbird-service-meta 支持 ESM 还是 CommonJS?

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

@crvouga/mockingbird-service-meta 可以商用吗?

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

@crvouga/mockingbird-service-meta 的下载量有多少?

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

@crvouga/mockingbird-service-meta 还在维护吗?

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