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

@wxobs/wxobs-miniprogram-sdk

v0.1.1

Published

1. 安装:在小程序代码根目录下执行 `tnpm install @tencent/wxobs-miniprogram-sdk` 2. 构建:在微信开发者工具中,点击左上角菜单栏中“工具” -> “构建npm” 3. 使用:在 app.js 文件中引入 setup 函数,并在 onLaunch 中执行即可启动采集。

Downloads

3

Readme

安装与使用

  1. 安装:在小程序代码根目录下执行 tnpm install @tencent/wxobs-miniprogram-sdk
  2. 构建:在微信开发者工具中,点击左上角菜单栏中“工具” -> “构建npm”
  3. 使用:在 app.js 文件中引入 setup 函数,并在 onLaunch 中执行即可启动采集。

示例代码:

import wxobs from '@tencent/wxobs-miniprogram-sdk';

App({
  onLaunch: function () {
    wxobs.setup({
      isWhitelistMaskMode: true
    })
  },
});

API

setup

配置并启动用户行为采集。 参数:

{
  isWhitelistMaskMode?: boolean // 可选,默认值 true。true 表示以白名单模式遮罩小程序中的元素,false表以黑名单模式遮罩小程序中的元素。
  autoStart?: boolean // 可选,默认值 true。是否自动开采集。若为 false,需自行调用 start 函数启动采集。
  attrs?: Record<string, string> // 对回放添加属性,在管理端可通过属性筛选回访
  captureDataAttrs?: boolean // 可选,默认为 true。采集 webview 中的元素时,是否采集以 data-* 为开头的属性
  shouldCapturePage?: (page: string, query: Record<string, string>) => boolean // 可选。用于控制是否采集某页面的回调,page 和 query 是该页面的属性,默认为全部采集。
}

setAttrs

param
attrs: Record<string, string> // 属性的键值对

向当前回放添加键值对属性,回放端可通过该属性筛选回放。

example
setAttrs({
  gender: 'male',
  age: '18',
})

文档

隐私

屏蔽

为保护用户隐私,采集模块屏蔽了以下数据:

  • 所有 input 事件
  • open-data
  • 小程序插件内容
遮罩

采集模块提供了对图片、视频、文本内容的遮罩功能。对需要遮罩的图片和视频,采集模块会将原图片或视频替换成骨架图上报,文本则替换成星号。

开发者可根据需要,在 setup 时配置 isWhitelistMaskMode 来选择白名单遮罩模式或黑名单遮罩模式。

在白名单模式下,SDK 会默认遮罩所有的元素,开发者可以在元素上添加类 "wxobs-unmask" 来解除该元素及其子元素的遮罩。 如

<view class="wxobs-unmask">
	...
</view>

在黑名单模式下,所有元素默认不遮罩。开发者可以针对敏感元素,在元素上添加类 "wxobs-mask" 来遮罩该元素及其子元素。 如

<view class="wxobs-mask">
	...
</view>