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-miniprogram-sdk

v4.1.0

Published

GrowngIO官方小程序 SDK,具备自动采集基本的用户行为事件,比如访问和行为数据等。目前支持微信小程序、支付宝小程序、百度小程序、字节(抖音头条)小程序、QQ小程序、淘宝小程序、京东小程序、快手小程序、快应用。

Downloads

70

Readme

GrowingIO 小程序采集 SDK (GrowingIO Miniprogram Autotracker)

GrowingIO

小程序SDK

介绍

小程序SDK4.0支持 微信小程序、支付宝小程序、百度小程序、字节(抖音头条)小程序、QQ小程序、淘宝小程序、快手小程序、京东小程序、快应用。

  • 埋点能力,开发同学可调用API主动采集自定义事件。
  • 插件无埋点能力,自动采集用户行为事件,可通过开关和插件控制。
  • 插件半自动埋点浏览能力,除快应用外,其他小程序均支持半自动埋点浏览事件。
  • 可依据使用场景自由拆分 SDK,减少大小。
  • 支持自定义插件开发。

官方集成文档(Integration Document)

集成文档

开发

检查环境

Nodejs 版本>=16,推荐使使用 nvm 进行 Nodejs 版本管理

安装依赖包

npm install

打包

打包SDK

npm run build:wx // 原生微信小程序 npm run build:my // 原生支付宝小程序 npm run build:swan // 原生百度小程序 npm run build:tt // 原生字节头条小程序 npm run build:qq // 原生QQ小程序 npm run build:jd // 原生京东小程序 npm run build:ks // 原生快手小程序 npm run build:tb // 原生淘宝小程序 npm run build:quickapp // 原生快应用 npm run build:uniapp // uni-app框架 npm run build:taro // Taro框架

打包插件

npm run build:plugins

开发插件

  • 这里提供一个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 小程序 SDK 完全免费并开源,请注意仔细甄别。欢迎大家一起学习进步和互相帮助。

Tips:请注意开源协议。