@churnassassin/sentry-beacon

中文文档
1.0.3发布于 2025/08/24MITCommonJS零依赖近 30 天下载 1774

NPM loader for the Churn Assassin Sentry Beacon tracking agent

原始使用文档
文档目录6 节
  1. 🚀 Installation
  2. ✅ Usage
  3. 💡 What It Does
  4. 🔐 Notes
  5. 🛠️ Support
  6. 📄 License

@churnassassin/sentry-beacon

The official NPM loader for the Sentry Beacon and Sentry Panel tracking agents used by Churn Assassin.

This lightweight module allows you to initialize customer activity tracking from within your frontend JavaScript app (React, Vue, etc.) without needing to manually embed <script> tags.


🚀 Installation

npm install @churnassassin/sentry-beacon

✅ Usage

Import and initialize the beacon in your frontend app (e.g., React, Vue, plain JS):

import { initSentryBeacon } from '@churnassassin/sentry-beacon'

initSentryBeacon({
token: "[Provided By Churn Assassin]",
useragent: navigator.userAgent,
activity: window.location.pathname,    // or other variable containing the event
qs: window.location.search,            // or other variable containing event details
company_name: 'ABC-123',               // Alpha-numeric company name
companyid: 'ABC-123',                  // Alpha-numeric company id
enduser_email: '[email protected]',     // email of end user logged into your app
enduser_firstname: 'Jane',             // first name of end user logged into your app
enduser_lastname: 'Doe',               // last name of end user logged into your app
enduserid: 'user-789',                 // unique id of end user logged into your app
productid: '1',                        // Numeric, default: 1
platformid: '2'                        // Numeric, default: 2
})

💡 What It Does

When called, this function:

  1. Assigns a global window.assassindata object with all user/session metadata.
  2. Injects the Sentry Beacon script:
    https://api.churnassassin.com/static/js/churnassassin.js
  3. Injects the Sentry Panel script (optional UI module):
    https://api.churnassassin.com/static/js/engagement.js

These scripts then begin reporting usage and engagement activity within your application to Churn Assassin.


🔐 Notes

  • Make sure token and user-specific fields are injected dynamically based on your current logged-in user.
  • Scripts are only injected once per page load (duplicate protection is built-in).
  • This module is intended to run in the browser only (not SSR).
  • SPA's (single page applications): Should use a custom router to populate the [activity] and [qs] properties

🛠️ Support

Need help? Email [email protected] or contact your onboarding specialist.


📄 License

MIT © Brian Polackoff / Churn Assassin

版本与发布记录

@churnassassin/sentry-beacon 共发布 4 个版本,首次发布于 2025/07/28;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.3latest2025/08/241.2 年前
1.0.22025/08/021.3 年前
1.0.12025/07/281.3 年前
1.0.02025/07/281.3 年前

关于 @churnassassin/sentry-beacon 的常见问题

@churnassassin/sentry-beacon 是什么?

NPM loader for the Churn Assassin Sentry Beacon tracking agent

如何安装 @churnassassin/sentry-beacon?

在项目目录运行 npm install @churnassassin/sentry-beacon,或使用 pnpm add / yarn add / bun add。

@churnassassin/sentry-beacon 支持 TypeScript 吗?

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

@churnassassin/sentry-beacon 支持 ESM 还是 CommonJS?

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

@churnassassin/sentry-beacon 可以商用吗?

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

@churnassassin/sentry-beacon 的下载量有多少?

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

@churnassassin/sentry-beacon 还在维护吗?

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