English | 简体中文
Ohbug is a JavaScript monitoring module that integrates behavior monitoring, exception monitoring, and custom behavior monitoring.
Through a flexible extension system, you can achieve performance monitoring, collection of specific information, and advanced features like session replay ("screen recording").
- 🔍 Error Monitoring — Automatically captures uncaught errors, resource errors, unhandled rejections, AJAX/Fetch errors, and WebSocket errors
- 🧩 Extension System — Extend functionality with a flexible plugin architecture
- 📱 Multi-Framework — First-class support for React, Vue, and Angular
- 🎬 Session Replay — Record and replay user sessions via rrweb extension
- 📦 Lightweight — Tree-shakable ESM modules with zero unnecessary bloat
- 🔧 Customizable — Hooks (
onEvent,onNotify), user tracking, metadata, and action recording
npm install @ohbug/browserimport Ohbug from "@ohbug/browser";
const client = Ohbug.setup({
apiKey: "YOUR_API_KEY",
appVersion: "1.0.0",
});npm install @ohbug/browser @ohbug/reactimport Ohbug from "@ohbug/browser";
import { OhbugErrorBoundary } from "@ohbug/react";
const client = Ohbug.setup({ apiKey: "YOUR_API_KEY" });
function App() {
return (
<OhbugErrorBoundary client={client} FallbackComponent={<div>Something went wrong</div>}>
<YourApp />
</OhbugErrorBoundary>
);
}npm install @ohbug/browser @ohbug/vueimport Ohbug from "@ohbug/browser";
import { install } from "@ohbug/vue";
const client = Ohbug.setup({ apiKey: "YOUR_API_KEY" });
install(client, Vue);npm install @ohbug/browser @ohbug/angularimport Ohbug from "@ohbug/browser";
import createProvider from "@ohbug/angular";
const client = Ohbug.setup({ apiKey: "YOUR_API_KEY" });
const provider = createProvider(client, ErrorHandler);| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string |
— | Required. Your project API key |
appVersion |
string |
— | Application version |
appType |
string |
— | Application type identifier |
releaseStage |
string |
"production" |
Current release stage |
endpoint |
string |
"http://localhost:6660" |
Event reporting endpoint |
maxActions |
number |
30 |
Max number of actions to keep (0–100) |
onEvent |
function |
— | Hook called when an event is created |
onNotify |
function |
— | Hook called when an event is reported |
user |
object |
— | User info (up to 6 attributes) |
metadata |
object |
— | Additional metadata |
logger |
object |
console |
Custom logger with log/info/warn/error |
| Package | Description |
|---|---|
| @ohbug/core | Core module — client, events, extensions, actions |
| @ohbug/browser | Browser SDK — auto-captures errors, network issues, etc. |
| @ohbug/react | React integration — OhbugErrorBoundary component |
| @ohbug/vue | Vue integration — Vue error handler plugin |
| @ohbug/angular | Angular integration — ErrorHandler provider |
| @ohbug/types | TypeScript type definitions for all packages |
| @ohbug/utils | Shared utility functions |
- @ohbug/miniapp — SDK for Mini Programs
- @ohbug/unplugin — Build plugin for uploading sourcemaps
- @ohbug/cli — CLI tool for uploading sourcemaps
- Extensions — Official extensions (rrweb, performance, etc.)
- ohbug-dashboard — Self-hosted dashboard (NestJS + Next.js)
git clone git@github.com:ohbug-org/ohbug.git
cd ohbug
pnpm installpnpm dev # Watch mode for all packages
pnpm build # Build all packages
pnpm test # Run tests (vitest)
pnpm check # Type check with auto-fix
pnpm lint # Lint with auto-fix
pnpm fmt # Format codeA React playground app is included for local development and testing:
cd playground
pnpm dev # Starts at http://localhost:4000This project exists thanks to all the people who contribute.
| GitHub Issues | |
|---|---|
| ohbug-org/ohbug/issues | 关注后回复「ohbug」 |
