Skip to content

Ohbug 小程序 SDK 用于小程序平台(支持微信、字节跳动、支付宝、QQ 小程序)

License

Notifications You must be signed in to change notification settings

ohbug-org/ohbug-miniapp

Repository files navigation

Ohbug

开源应用信息监控平台

@ohbug/miniapp

npm npm bundle size Code style

Feature

  • 支持 微信小程序、支付宝小程序、字节跳动小程序、QQ 小程序
  • 支持 Taro 等第三方小程序框架
  • 监听小程序 onErroronUnhandledRejectiononPageNotFoundonMemoryWarning API
  • 收集小程序的设备、系统、应用信息
  • 收集异常发生时的路由栈

Usage

  1. 安装依赖
yarn add @ohbug/miniapp

或直接下载 releases

  1. 「微信开发者工具 - 工具 - 构建 npm」,更多内容可查询文档

  2. 初始化

// 新建文件 ohbug.js
// 引入 SDK
import Ohbug from "@ohbug/miniapp";
// 或者直接引入js
import Ohbug from "./ohbug-miniapp.esm.prod.js"
// or
const Ohbug = require("./ohbug-miniapp.cjs.prod.js")

const client = Ohbug.init({ apiKey: "YOUR_API_KEY" });
export default client;
// app.js
import './ohbug';

App({
  onLaunch() {
    // ...
  }
})

Note

  • 请开启「微信开发者工具 - 设置 - 项目设置 - 增强编译」
  • 请在小程序管理后台配置 request 合法域名 https://api.ohbug.net/report
  • 目前字节跳动小程序不支持使用 npm 形式接入 请直接引入 js 文件

License

This project is licensed under the terms of the Apache License 2.0.

About

Ohbug 小程序 SDK 用于小程序平台(支持微信、字节跳动、支付宝、QQ 小程序)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors