npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aijdo/jdo-bi-web-sdk

v1.2.2

Published

极豆webjs神策埋点sdk

Downloads

24

Readme

@aijdo/jdo-bi-web-sdk

SDK接入

说明

安装:

npm install @aijdo/jdo-bi-web-sdk;

使用:

import SDK from '@aijdo/jdo-bi-web-sdk';
let sdk= new SDK(
    {
      server_url:埋点数据接收的服务url, // (上传数据地址)
      ...其他参数 参考[https://manual.sensorsdata.cn/sa/latest/tech_sdk_client_web_high-7549300.html]
    }
);

基础功能

初始化(强制实现)

// 开启收集
 sdk.start();

元素点击事件代码埋点触发

sdk.track(
        'Event Name', //自定义事件名称
        {'Event Attr': "attr"} // 自定义属性 非必填
    );

高级用法

单页面中事件的自动采集

自动模式
// 配置参数 is_track_single_page (推荐使用这种模式),默认值为 true ,表示是否开启自动采集 web 浏览事件 $pageview 的功能 。
// 其原理是修改 window 对象的 pushState 和 replaceState 原生方法,在页面的 url 改变后自动采集 $pageview 事件,若用户浏览器不支持这两种方法或者是使用 hash 的路由模式,我们也会监听 popstate 和 hashchange 事件来自动触发 $pageview 事件。

is_track_single_page:true // 表示单页面自动采集
手动模式
// 在页面切换的时候,手动调用来采集 web 浏览事件 $pageview ,这个方法在页面 url 切换后调用。

sdk.quick('autoTrackSinglePage');

登录(强制实现)

// 要求:传入的uid必须是JDO的uid。如果是OEM侧的产品,则必须传入oem_uid

 sdk.login(uid,oem_uid);

设置公共属性(所有埋点事件需要添加的属性)

// 要求:所有埋点事件需要添加的属性 纬度(纬度的10^6次方取整) 经度(经度的10^6次方取整)

 sdk.register({
    $latitude:161123456, // 纬度(纬度的10^6次方取整)
    $longitude:161123456,    // 经度(经度的10^6次方取整)
});

设置用户属性

// setProfile() 方法可以设定用户属性,同一个 key 多次设置时,value 值会进行覆盖替换。

 sdk.setProfile({email:'xxx@xx'});

退出登录

sdk.logout(true)