Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bnfe/track-sdk

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bnfe/track-sdk

巴奴埋点上报SDK

  • 1.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
0
Weekly downloads
 
Created
Source

代码埋点

  • 实时上报:业务方调用发送埋点的 api 后, 立即发出上报请求
  • 延时上报:sdk 内部收集业务方要上报的信息, 在浏览器空闲时间或者页面卸载前统一上报,上报失败会做补偿措施

使用

ESM 导入使用

import TrackSDK from "@bnfe/track-sdk";
TrackSDK.init({
  server_url: "http://127.0.0.1:3000/api/event",
  debounce: 500
});
TrackSDK.track({ event_name: "test", event_data: { a: 1, b: 2 } });

CJS 导入使用

const TrackSDK = require("@bnfe/track-sdk");
TrackSDK.init({
  server_url: "xxx/api",
  debounce: 500
});
TrackSDK.track({ event_name: "test", event_data: { a: 1, b: 2 } });

UMD 直接使用

<script src="xxx/dist/track-sdk.umd.js"></script>
<script>
  TrackSDK.init({
    server_url: "xxx/api",
    debounce: 500
  });
  TrackSDK.track({ event_name: "test", event_data: { a: 1, b: 2 } });
</script>

FAQs

Package last updated on 22 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc