@libshub/shence-sensor
v0.0.2
Published
神策埋点SDK
Downloads
327
Readme
工具神策日志上报SDK
版本
node 14+
sa-javascript-sdk 1.21.6+
react 17+
使用方法
import {shenceIdentifyUser,shenceInit,shenceSetPageProperties,shenceTrack} from '@crc/shence-sensor';
shenceInit({ project: 'default', show_log: true });
// 开发模式可以覆盖默认发送方式
shenceInit({ project: 'default', show_log: true, send_type: 'ajax' });
shenceIdentifyUser(userId);
shenceSetPageProperties(fields);
shenceTrack('MyModule', 'MyTarget', 'MyAction', { is_success: true }).then((properties) => {
console.log('shence track event success', properties);
}).catch((error) => {
console.error('shence track event failed', error);
});