@bnfe/track-sdk
v1.0.6
Published
巴奴埋点上报SDK
Downloads
100
Keywords
Readme
代码埋点
使用
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>