Preparing your workspace...

assistant-chat.tsx2.5k
utils.ts850
button.tsx720
Quick Actions
codmir
Docs
Discord
Get started
API
  • Introduction
  • Installation
  • Your First Project
  • Your First Agent
  • Overview
  • OverseerClient
  • Error Tracking
  • Session Replay
  • Incidents
  • Deployments
  • Orchestrator
    • Next.js
    • React
    • Express
    • Vue
    • Svelte

Set up Overseer in your React application

React Integration

Set up Overseer in any React application (Create React App, Vite, etc.)

Installation

npm install @codmir/overseer
yarn add @codmir/overseer
pnpm add @codmir/overseer
bun add @codmir/overseer

Setup

Initialize Overseer at the entry point of your app:

// src/main.tsx or src/index.tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import { init } from '@codmir/overseer';
import App from './App';

// Initialize Overseer before rendering
init({
  dsn: import.meta.env.VITE_OVERSEER_DSN,
  service: 'react-app',
  environment: import.meta.env.MODE,
  enableReplay: true,
  enablePerformance: true,
});

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

Error Boundary

Create an error boundary component to catch and report errors:

// src/components/ErrorBoundary.tsx
import React, { Component, ReactNode } from 'react';
import { captureException } from '@codmir/overseer';

interface Props {
  children: ReactNode;
  fallback?: ReactNode;
}

interface State {
  hasError: boolean;
  error?: Error;
}

export class ErrorBoundary extends Component<Props, State> {
  constructor(props: Props) {
    super(props);
    this.state = { hasError: false };
  }

  static getDerivedStateFromError(error: Error): State {
    return { hasError: true, error };
  }

  componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
    captureException(error, {
      extra: { componentStack: errorInfo.componentStack },
    });
  }

  render() {
    if (this.state.hasError) {
      return this.props.fallback || (
        <div className="error-boundary">
          <h2>Something went wrong</h2>
          <p>{this.state.error?.message}</p>
          <button onClick={() => this.setState({ hasError: false })}>
            Try again
          </button>
        </div>
      );
    }

    return this.props.children;
  }
}

Wrap your app with the error boundary:

// src/App.tsx
import { ErrorBoundary } from './components/ErrorBoundary';

function App() {
  return (
    <ErrorBoundary>
      <YourAppContent />
    </ErrorBoundary>
  );
}

Usage

import { captureException, addBreadcrumb, setUser } from '@codmir/overseer';

function UserProfile({ user }) {
  // Set user context when they log in
  useEffect(() => {
    setUser({
      id: user.id,
      email: user.email,
      username: user.name,
    });
  }, [user]);

  const handleAction = async () => {
    addBreadcrumb({
      category: 'user.action',
      message: 'User performed action',
      level: 'info',
    });

    try {
      await performAction();
    } catch (error) {
      captureException(error);
    }
  };

  return <button onClick={handleAction}>Do Action</button>;
}

Environment Variables

# .env (Vite)
VITE_OVERSEER_DSN=https://your-project.codmir.com/overseer

# .env (Create React App)
REACT_APP_OVERSEER_DSN=https://your-project.codmir.com/overseer
Open in ChatGPTOpen in ClaudeConnect MCP on CursorConnect MCP on WindsurfEdit on GitHub
codmir
Products
Desktop AppMobile AppIDE ExtensionAI AgentsOverseerVoice ModeCortex ProtocolHive MindGame Dev (Godat)PricingDownload
Solutions
AI Code AgentsCode ReviewError TrackingSelf-HealingDeploy TrackingAI Tracking SDKWorkflow AutomationTesting FrameworkTime TrackingVoice Control
Platform
ProjectsTickets & BoardsAgent MarketplaceIntegrationsTemplatesApp HubAdmin PanelAnalytics
Integrations
GitHubSlackDiscordVercelSentryRailwayLinearAll Integrations
Developers
DocumentationAPI ReferenceSDKCLIDeveloper PortalMarketplaceMCP ConnectorsWebhooksExamplesnpm Packages
Resources
BlogChangelogCommunityTutorialsGet StartedSupportStatusFeedback
Company
AboutCareersContact SalesKickstarterReferral Program
Legal
Terms of UsePrivacy PolicyEULATrademarkSecurity
Download on the App StoreGet it on Google Play

Codmir™ 2026. All rights reserved.

Free & open source SDK — Apache 2.0 License