@xrayradar/react
v0.2.0
Published
XrayRadar SDK for React - ErrorBoundary, hooks, provider
Maintainers
Readme
@xrayradar/react
XrayRadar SDK for React – ErrorBoundary, XrayRadarProvider, useXrayRadar, and re-exports from @xrayradar/browser for XrayRadar error tracking.
Install
npm install @xrayradar/reactQuick start
import { init, captureException, ErrorBoundary } from "@xrayradar/react";
init({
dsn: "https://xrayradar.com/your_project_id",
authToken: "your-token",
// Optional: enable browser integrations (fetch/XHR/history/console)
// integrations: true,
});
function App() {
return (
<ErrorBoundary>
<YourApp />
</ErrorBoundary>
);
}Configuration
init(options) supports the same options as @xrayradar/browser:
dsn,authToken,debugenvironment,release,serverNamesampleRate,maxBreadcrumbsbeforeSend(event)(sync or async)transportintegrations(fetch/XHR/history/console)
Requires React 17+. For Next.js, use @xrayradar/nextjs. Full docs and Remix setup: XrayRadar-JS-SDK.
