@activeprospect/trustedform-cert-id

中文文档
1.1.7发布于 2026/07/28ISCCommonJS近 30 天下载 1937

Node.JS library for decrypting the TrustedForm Certificate URL

原始使用文档
文档目录7 节
  1. Certificate ID Types
  2. Web Certificate ID
  3. Mobile Certificate ID
  4. Social Certificate ID
  5. Facebook Certificate ID
  6. Ping ID
  7. Masked ID

TrustedForm Cert ID

This library handles decrypting TrustedForm certificate IDs, which contain metadata about the certificate. Generally speaking, this library can extract the certificate type and the certificate creation date.

Certificate ID Types

There are several different formats of certificate IDs, depending on the certificate type.

Web Certificate ID

This is the most common form of certificate identifier. It looks like a SHA1 hash (40 character hexidecimal string). Web certificate IDs contain two properties:

  • type: 'web' — The type of these certificates will always be "web"
  • createdAt — The Date the certificate was created

Example: eb9fc4dd9bed9ad451a5648946cf4bf09b5bb947

Mobile Certificate ID

Mobile certificates are created by the TrustedForm Mobile SDK, which supports collecting certs from mobile platform applications built on iOS and Android. Mobile certificates IDs contain two properties:

  • type: 'mobile' — The type of these certificates will always be "mobile"
  • createdAt — The Date the certificate was created

Example: 11NgkzK_mroUbOD1-x66NigDliU1kdvbaCtLGvyja1K80vU1sKh9grlwP78vzKSp4ncwAfJAlNPNVY8f

Social Certificate ID

Social certificates follow the same ID format as web certificates (a 40-character hexidecimal string, or a base64-uri encoded form for mobile), but encode s as their type byte. Social certificate IDs contain two properties:

  • type: 'social' — The type of these certificates will always be "social"
  • createdAt — The Date the certificate was created

Facebook Certificate ID

Certificates generated for Facebook Lead Ads contain extra metadata:

  • type: 'facebook' — The type of these certificates will always be "facebook"
  • createdAt — The Date the certificate was created
  • accountId — The ActiveProspect account ID for the account that generated the certificate
  • pageId — the Facebook page identifier where the certificate was generated
  • leadId — the Facebook lead identifier associated with the certificate

Example: 0.rpM21ddljS9BNNUOm6FZVVqb5C5JMk1cofI4nDGdwy5ezucyxjok9qLyUXMu9diW62Xac8xNMpomBf1B-XDpfbYvaFMr0YC-54TzHcLrni4.OHOMoMFXaX9YW9DoX_xeng.1vnf6DTWU7sJo6XAxlRP_w

Ping ID

TrustedForm implements ping URLs to be used during the ping phase of a ping/post lead auction. Ping IDs are really just a pointer to the real certificate ID. The properties of these IDs are:

  • type — The type of the real certificate
  • createdAt — The Date the real certificate was created

Example: 0.1JT7QUPI1sOFZxpr72ZK45K0ck75kEBO9H3jNJuX8NkqMTv4UF-zrapBUlsefTP3lkXWh6qM.fF0DNrov0zNUNVRCqDV5dw.E2eYOJ5-dnAgiX02-96FNQ

Masked ID

TrustedForm supports certificate masking. A masked certificate hides important details like the session replay. Currently, masked certificate IDs do not contain any metadata beyond the type property:

  • type: 'masked' — The type of these certificates will always be "masked"

Usage

This library requires that two seperate private decryption keys be set in environment variables. These variables are named the same as in the TrustedForm platform, for consistency.

  • CERT_IDS_SECRET_KEY — The private key used to decrypt web and mobile certificate IDs
  • TF_CONFIG_CERT_ID_SECRET — The private key used to decrypt all certificate IDs starting with 0.

To decrypt a certificate ID, call the decrypt() function:

const { decrypt } = require('@activeprospect/trustedform-cert-id');
const decrypted = decrypt('eb9fc4dd9bed9ad451a5648946cf4bf09b5bb947');
console.log(decrypted);
// { 
//   type: 'web',
//   createdAt: 2022-03-08T20:20:16.000Z
// }

To build a ping ID for a given certificate ID, call the ping() function:

const { ping } = require('@activeprospect/trustedform-cert-id');
const certId = 'a1028cbb41b876744fa752eec276bec0e4c48b33';
const pingId = ping(certId);
console.log(pingId);
// 0.1JT7QUPI1sOFZxpr72ZK45K0ck75kEBO9H3jNJuX8NkqMTv4UF-zrapBUlsefTP3lkXWh6qM.fF0DNrov0zNUNVRCqDV5dw.E2eYOJ5-dnAgiX02-96FNQ

版本与发布记录

@activeprospect/trustedform-cert-id 共发布 8 个版本,首次发布于 2022/03/18;过去 12 个月发布了 1 个版本。

版本发布日期距今
1.1.7latest2026/07/283 个月前
1.1.52024/08/082 年前
1.1.42022/12/143 年前
1.1.32022/10/144 年前
1.1.22022/10/134 年前
1.1.12022/04/014 年前

关于 @activeprospect/trustedform-cert-id 的常见问题

@activeprospect/trustedform-cert-id 是什么?

Node.JS library for decrypting the TrustedForm Certificate URL

如何安装 @activeprospect/trustedform-cert-id?

在项目目录运行 npm install @activeprospect/trustedform-cert-id,或使用 pnpm add / yarn add / bun add。

@activeprospect/trustedform-cert-id 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/activeprospect__trustedform-cert-id 是否存在。

@activeprospect/trustedform-cert-id 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@activeprospect/trustedform-cert-id 可以商用吗?

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

@activeprospect/trustedform-cert-id 的下载量有多少?

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

@activeprospect/trustedform-cert-id 还在维护吗?

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