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

sentry-miniprogram

v0.1.8

Published

Sentry微信小程序端SDK

Readme

Sentry Miniprogram

安装和使用

使用npm/yarn安装及使用微信开发工具构建包

# npm
npm install sentry-miniprogram -S
# yarn
yarn add sentry-miniprogram -S

使用

import Sentry from 'sentry-miniprogram'

Sentry.init({
    dsn: '__DSN__'
})

Sentry.captureMessage('Hello, world!');

API

在追寻官方API规范中,完成了以下功能(若已有的方法实现有差异或期望实现未实现的功能欢迎提出或PR

  • Sentry.init(options)
    • options.dsn: string:: 项目DSN
    • options.enabled?: boolean:是否启用Sentry,禁用后所有方法可调用但不会有上报功能,默认启用
    • options.environment?: string: 环境,自定义字符串,默认 production
    • options.maxBreadcrumbs?: number:最大保存的breadcrumb数量,超过指定数值后,先加入的会被丢弃,默认为20个
    • options.getErrorStacktrace?: (err: Error) => Promise<Stacktrace>:提供自定义获取错误对象的源码信息来上报更加丰富的错误信息,返回值Stacktrace参考文档
  • Sentry.captureMessage(message: string, level: string = 'info'): void
  • Sentry.captureException(error: Error): void
  • Sentry.configureScope(callback: (scope): void)
    • scope.setUser(user): void:
    • scope.addBreadcrumb(breadcrumb | string): void: 支持传递字符串和Breadcrumb对象,如传递字符串则作为Breadcrumb象的message字段保存,其中timestamp默认值为当前调用方法秒时间戳
    • scope.clearBreadcrumbs(): void
    • scope.setTag(key: string, val: any): void
    • scope.removeTag(key: string): void
    • scope.setTags(tags: { [props: string]: any }): void
  • Sentry.(...scope):对于scope的方法映射,如Sentry.setUser(user)