@overcastsre/react
v2.0.0
Published
Overcast SRE monitoring SDK for React — captures everything with ErrorBoundary.
Maintainers
Readme
@overcast/react
Overcast SRE monitoring SDK for React. Wrap your app — captures everything.
Install
npm install @overcast/reactUsage
import { OvercastProvider } from '@overcast/react';
function App() {
return (
<OvercastProvider apiKey="oc_..." serviceName="my-app">
<YourApp />
</OvercastProvider>
);
}That's it. The SDK automatically captures everything from @overcast/browser plus:
- React component render errors (via ErrorBoundary)
- Component stacks for every error
- Custom fallback UI support
Hook
import { useOvercast } from '@overcast/react';
function MyComponent() {
const overcast = useOvercast();
overcast.info('User clicked checkout', { cartSize: 5 });
}HOC (for class components)
import { withOvercast } from '@overcast/react';
export default withOvercast(MyClassComponent);