A powerful, TypeScript-first logging SDK with automatic error tracking, performance monitoring, and user interaction capture. Similar to Sentry and LogRocket, but with full control over your data.
With zero configuration, the SDK automatically captures comprehensive telemetry data
Experience auto-instrumentation in action. Trigger events and see real-time capture.
Application started
{ "version": "1.0.0", "environment": "demo" }
High memory usage detected
{ "usage": "85%", "threshold": "80%" }
Install, initialize, and start capturing events automatically
npm install monita
yarn add monita
pnpm add monita
import { Monita } from "monita";
// Initialize with auto-instrumentation
const logger = new Monita({
apiKey: "your-api-key",
projectId: "your-project-id",
environment: "production",
serviceName: "my-web-app",
});
// That's it! Auto-capture is already working:
// ✅ JavaScript errors are automatically captured
// ✅ Network requests are monitored
// ✅ Performance metrics are collected
// ✅ Page views are tracked
// Manual logging (optional - auto-capture handles most cases)
logger.info("User started checkout");
logger.error("Payment failed", new Error("Card declined"));
// Enhanced logging with context
logger.setContext({
userId: "12345",
feature: "checkout",
experimentId: "ab-test-v2",
});
// Capture exceptions with additional context
logger.captureException(new Error("Something broke"), {
component: "PaymentForm",
action: "submit",
});
Uncaught exceptions and promise rejections
Core Web Vitals, page load times
Fetch/XHR monitoring with timing
Navigation and SPA route changes
Comprehensive observability with intelligent automation and privacy protection
IN DEVELOPMENT
error AND database AND "connection timeout"
level:error service:api-server userId:123
timestamp:[2024-01-01 TO 2024-01-31] AND level:warn
Combine multiple filters with AND/OR logic. Save frequently used filter combinations.
Comprehensive reference for all methods, options, and configuration
logger.info(message, data?)
logger.warn(message, data?)
logger.error(message, error?)
logger.debug(message, data?)
captureException(error, context?)
captureMessage(message, level, data?)
addBreadcrumb(message, category?)
setContext(context)
clearContext()
withContext(context, callback)
startTimer(name)
endTimer(name)
measureFunction(fn, name?)
logger.flush()
logger.close()
logger.isEnabled()
logger.setLogLevel(level)
logger.enable() / logger.disable()
logger.updateConfig(config)
Follow these guidelines to maximize the value of auto-instrumentation
Let the SDK capture most events automatically - manual logging should be minimal
Use setContext() to add user ID, feature flags, and business context
Use different log levels and capture settings for dev/staging/prod
Use breadcrumbs to trace user journeys through multi-step processes
The SDK is lightweight (~50KB) but monitor your bundle analyzer
Auto-capture handles most cases - excessive manual logging creates noise
User interactions and console messages can be very verbose
Review auto-sanitization settings and add custom filters if needed
Add React/Vue error boundaries for comprehensive error capture
Initialize the SDK early but don't block app startup on SDK errors
Upcoming features and improvements to the Monita SDK
Comprehensive documentation, examples, and community support
Join thousands of developers who trust Monita SDK for comprehensive auto-instrumentation