open-index/open-npm huggingface dataset:
npm package: @ohbug/miniapp
Description: Ohbug 小程序 SDK 用于小程序平台（支持微信、字节跳动、支付宝、QQ 小程序）
Author: chenyueban
Latest version: 1.0.1

# `@ohbug/miniapp`

[![npm](https://img.shields.io/npm/v/@ohbug/miniapp.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/miniapp)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/miniapp?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/miniapp)
[![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

## Feature

- 支持 微信小程序、支付宝小程序、字节跳动小程序、QQ 小程序
- 支持 [Taro](https://taro.aotu.io/) 等第三方小程序框架
- 监听小程序 `onError`、`onUnhandledRejection`、`onPageNotFound`、`onMemoryWarning` API
- 收集小程序的设备、系统、应用信息
- 收集异常发生时的路由栈

## Usage

1. 安装依赖
```shell
yarn add @ohbug/miniapp
```
或直接下载 [releases](https://github.com/ohbug-org/ohbug-miniapp/releases)

2. 「微信开发者工具 - 工具 - 构建 npm」，更多内容可查询[文档](https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html)

3. 初始化
```javascript
// 新建文件 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;
```

```javascript
// 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](https://github.com/ohbug-org/ohbug-miniapp/blob/master/LICENSE).
npm package: @ohbug/plugin-perfume
Description: Ohbug plugin to collect performance information
Author: chenyueban
Latest version: 0.0.6

# `@ohbug/plugin-perfume`

[![npm](https://img.shields.io/npm/v/@ohbug/plugin-perfume.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/plugin-perfume)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/plugin-perfume?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/plugin-perfume)
[![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Package [perfume.js](https://github.com/Zizzamia/perfume.js), to collect performance information.

## Installation

```
yarn add perfume.js @ohbug/plugin-perfume
```

## Usage

```javascript
import { applyPlugin } from '@ohbug/core'
import ohbugPluginPerfume from '@ohbug/plugin-perfume'
import { init } from '@ohbug/browser'

const enhancer = applyPlugin(ohbugPluginPerfume)
init({ apiKey: 'YOUR_API_KEY' }, enhancer)
```
npm package: @ohbug/plugin-rrweb
Description: Ohbug plugin to 'screen recording'
Author: chenyueban
Latest version: 0.0.4

# `@ohbug/plugin-rrweb`

[![npm](https://img.shields.io/npm/v/@ohbug/plugin-rrweb.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/plugin-rrweb)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/plugin-rrweb?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/plugin-rrweb)
[![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Package [rrweb](https://github.com/rrweb-io/rrweb), to "screen recording".

## Installation

```
yarn add rrweb @ohbug/plugin-rrweb
```

## Usage

```javascript
import { applyPlugin } from '@ohbug/core'
import ohbugPluginRrweb from '@ohbug/plugin-rrweb'
import { init } from '@ohbug/browser'

const enhancer = applyPlugin(ohbugPluginRrweb)
init({ apiKey: 'YOUR_API_KEY' }, enhancer)
```
npm package: @ohbug/react
Description: Ohbug SDK for React
Author: xinyao
Latest version: 2.0.10

# `@ohbug/react`

[![npm](https://img.shields.io/npm/v/@ohbug/react.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/react)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/react?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/react)

English | [简体中文](./README-zh_CN.md)

## Installation

```
pnpm instal @ohbug/browser @ohbug/react
```

## Usage

```jsx
import React from "react";
import Ohbug from "@ohbug/browser";
import { OhbugErrorBoundary } from "@ohbug/react";

const client = Ohbug.setup({ apiKey: "YOUR_API_KEY" });

function App() {
  return (
    <div className="App">
      <OhbugErrorBoundary client={client}>
        <HelloWorld />
      </OhbugErrorBoundary>
    </div>
  );
}
```
npm package: @ohbug/redux-middleware
Description: Redux middleware for propagating Redux state/actions to use with Ohbug
Author: chenyueban
Latest version: 1.0.13

# `@ohbug/redux-middleware`

[![npm](https://img.shields.io/npm/v/@ohbug/redux-middleware.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/redux-middleware)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/redux-middleware?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/redux-middleware)
[![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

English | [简体中文](./README-zh_CN.md)

## Installation

```
yarn add @ohbug/browser @ohbug/redux-middleware
```

## Usage

```js
import Ohbug from '@ohbug/browser'
import { createStore, applyMiddleware } from 'redux'
import createOhbugMiddleware from '@ohbug/redux-middleware'
import reducer from './reducer'

Ohbug.init({ apiKey: 'YOUR_API_KEY' })

const store = createStore(reducer, applyMiddleware(createOhbugMiddleware()))
```

## API

```typescript
import type { Action, MiddlewareAPI } from 'redux'
type CreateOhbugMiddlewareOption = (
  action: Action,
  store: MiddlewareAPI
) => Action | false
```

### example

```typescript
import type { Action, MiddlewareAPI } from 'redux'
function before(action: Action, store: MiddlewareAPI) {
  if (action.type === 'foo') {
    // You can filter on certain sensitive information, which will not be collected
    // Just return false
    return false
  } else if (action.type === 'bar') {
    // If you want to collect some data after processing
    return {
      type: action.type,
      payload: store.getState() + action.payload,
    }
  }
  return action
}

// ...
const store = createStore(
  reducer,
  applyMiddleware(createOhbugMiddleware(before))
)
```
npm package: @ohbug/types
Description: Types for all Ohbug SDKs
Author: xinyao
Latest version: 2.2.2

# `@ohbug/types`

[![npm](https://img.shields.io/npm/v/@ohbug/types.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/types)

Contains types used in all packages.
npm package: @ohbug/unplugin
Description: Unplugin for upload your sourceMap files to Ohbug
Author: chenyueban
Latest version: 0.2.0

# `@ohbug/unplugin`

[![npm](https://img.shields.io/npm/v/@ohbug/unplugin.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/unplugin)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/unplugin?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/unplugin)

English | [简体中文](./README-zh_CN.md)

Auto upload your sourceMap files to Ohbug for Vite, Webpack and Rollup. Powered by [unplugin](https://github.com/unjs/unplugin).

## Installation

```
npm install @ohbug/unplugin -D
```

## Usage

<details>
<summary>Vite</summary><br>

```ts
// vite.config.ts
import OhbugUnplugin from '@ohbug/unplugin/vite'

export default defineConfig({
  plugins: [
    OhbugUnplugin({
      apiKey: 'YOUR_API_KEY',
      appVersion: 'YOUR_APP_VERSION',
    }),
  ],
})
```

Example: [`playground/`](./playground/)

<br></details>

<details>
<summary>Rollup</summary><br>

```ts
// rollup.config.js
import OhbugUnplugin from '@ohbug/unplugin/rollup'

export default {
  plugins: [
    OhbugUnplugin({
      apiKey: 'YOUR_API_KEY',
      appVersion: 'YOUR_APP_VERSION',
    }),
    // other plugins
  ],
}
```

<br></details>

<details>
<summary>Webpack</summary><br>

```ts
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('@ohbug/unplugin/webpack')({
      apiKey: 'YOUR_API_KEY',
      appVersion: 'YOUR_APP_VERSION',
    }),
  ],
}
```

<br></details>

<details>
<summary>Nuxt</summary><br>

```ts
// nuxt.config.js
export default {
  buildModules: [
    [
      '@ohbug/unplugin/nuxt',
      {
        apiKey: 'YOUR_API_KEY',
        appVersion: 'YOUR_APP_VERSION',
      },
    ],
  ],
}
```

> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)

<br></details>

<details>
<summary>Vue CLI</summary><br>

```ts
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('@ohbug/unplugin/webpack')({
        apiKey: 'YOUR_API_KEY',
        appVersion: 'YOUR_APP_VERSION',
      }),
    ],
  },
}
```

<br></details>

<details>
<summary>esbuild</summary><br>

```ts
// esbuild.config.js
import { build } from 'esbuild'
import Starter from '@ohbug/unplugin/esbuild'

build({ plugins: [Starter()] })
```

<br></details>

## Options

```typescript
interface Options {
  apiKey: string
  appVersion: string
  appType?: string
  endpoint?: string
  deleteAfterUploading?: boolean
}
```

### apiKey

Your project API key.

### appVersion

The version number of your app. Conveniently locate the problem version.

### appType

The type of your app. If your app's codebase contains different entries, but reports to the same service, you may need to add `appType` to indicate the type of entry for the source of the problem.

### endpoint

The url of the upload server

### deleteAfterUploading

default is `false`
npm package: @ohbug/utils
Description: Utilities for all Ohbug SDKs
Author: xinyao
Latest version: 2.0.9

# `@ohbug/utils`

[![npm](https://img.shields.io/npm/v/@ohbug/utils.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/utils)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/utils?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/utils)

Common utilities used by the Ohbug.
Warning, This package is not part of our public API contract, please do not use it
npm package: @ohbug/vue
Description: Ohbug SDK for Vue
Author: xinyao
Latest version: 2.0.11

# `@ohbug/vue`

[![npm](https://img.shields.io/npm/v/@ohbug/vue.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/vue)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/vue?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/vue)

English | [简体中文](./README-zh_CN.md)

## Installation

```
pnpm instal @ohbug/browser @ohbug/vue
```

## Usage

Vue3

```javascript
import Vue from "vue";
import Ohbug from "@ohbug/browser";
import OhbugVue from "@ohbug/vue";

const client = Ohbug.setup({ apiKey: "YOUR_API_KEY" });

Vue.createApp(App).use(OhbugVue(client)).mount("#app");
```

Vue2

```javascript
import Vue from "vue";
import App from "./App.vue";
import Ohbug from "@ohbug/browser";
import OhbugVue from "@ohbug/vue";

const client = Ohbug.setup({ apiKey: "YOUR_API_KEY" });
OhbugVue(client).install(Vue);

new Vue({
  render: (h) => h(App),
}).$mount("#app");
```
npm package: @ohbug/webpack-plugin
Description: Webpack plugin for upload your sourceMap files to Ohbug
Author: chenyueban
Latest version: 1.0.13

# `@ohbug/webpack-plugin`

[![npm](https://img.shields.io/npm/v/@ohbug/webpack-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/webpack-plugin)
[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/webpack-plugin?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/webpack-plugin)
[![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

English | [简体中文](./README-zh_CN.md)

## Installation

```
yarn add @ohbug/webpack-plugin --dev
```

## Usage

```javascript
const OhbugWebpackPlugin = require('@ohbug/webpack-plugin')

const config = {
  // ...
  plugins: [
    new OhbugWebpackPlugin({
      apiKey: 'YOUR_API_KEY',
      appVersion: 'YOUR_APP_VERSION',
    }),
  ],
}
```

## Options

```typescript
interface Options {
  apiKey: string
  appVersion: string
  appType?: string
  url?: string
}
```

### apiKey

Your project API key.

### appVersion

The version number of your app. Conveniently locate the problem version.

### appType

The type of your app. If your app's codebase contains different entries, but reports to the same service, you may need to add `appType` to indicate the type of entry for the source of the problem.

### url

The url of the upload server