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 🙏

© 2024 – Pkg Stats / Ryan Hefner

gio-webjs-sdk

v4.2.2

Published

GrowngIO Web/H5/小程序内嵌页/Hybrid数据采集SDK

Downloads

29

Readme

GrowingIO WebJS SDK (GrowingIO WebJS Autotracker)

GrowingIO

Web/H5/小程序内嵌页/Hybrid数据采集 SDK

介绍

  • 无埋点能力,自动采集用户行为事件,可通过开关和插件控制。
  • 埋点能力,开发同学可调用 Api 主动采集自定义事件。
  • 支持半自动曝光事件。
  • 可依据使用场景自由拆分 SDK,减少大小。
  • 支持自定义插件开发。

官方集成文档(Integration Document)

集成文档

开发

检查环境

Nodejs 版本>=14,推荐使用 Nodejs v16。(推荐使用 nvm 进行 Nodejs 版本管理)

安装依赖包

npm install

开发

单独开发SDK

npm run dev

单独开发插件

npm run dev:plugins

打包

打包SDK和插件

默认打包umd格式

npm run build

指定打包esm格式

npm run bnuild:es

单独打包SDK

默认打包umd格式

npm run build:sdk

指定打包esm格式

npm run bnuild:sdk-es

单独打包插件

默认打包umd格式

npm run build:plugins

指定打包esm格式

npm run build:plugins-es

浏览器兼容性

| IE / Edge | Firefox | Chrome | Safari | Opera |Electron | | --------- | --------- | --------- | --------- | --------- | --------- | | IE11 / Edge > 15 major / Edge IE兼容模式| > 54 major | > 51 major | > 10 major | > 38 major | > 10 major |

开发插件

  • 这里提供一个Demo供参考:
/**
 * 名称:插件Demo
 * 用途:用于提供编写插件的模板。
 */
import { GrowingIOType } from '@/types/growingIO';

class GioDemoPlugin {
  constructor(public growingIO: GrowingIOType) {
    const { emitter } = this.growingIO;
    emitter.on('SDK_INITIALIZED', (args) => { ...});
    // 其他可支持监听的消息名称请参考 src -> constants -> emitMsg.ts
  }

  onInstall(args) {
    // console.log('onInstall', args);
  }

  onError(args) {
    // console.log('onError', args);
  }

  onComposeBefore(args) {
    // console.log('onComposeBefore', args);
  }

  onComposeAfter(args) {
    // console.log('onComposeAfter', args);
  }

  onSendBefore(args) {
    // console.log('onSendBefore', args);
  }

  onSendAfter(args) {
    // console.log('onSendAfter', args);
  }
}

export default { name: 'gioDemoPlugin', method: GioDemoPlugin };

开源说明

开源的源代码移除了性能监控、第三方厂商适配以及定制化开发的一些商业化内容,和自动化测试的相关代码。仅保留相对完整的SDK主要内容。

GrowingIO WebJS SDK 完全免费并开源,请注意仔细甄别。欢迎大家一起学习进步和互相帮助。

Tips:请注意开源协议。