watchup-rn
v1.0.2
Published
React Native SDK for Watchup monitoring
Readme
watchup-rn
The official React Native SDK for Watchup, the error and status monitoring platform.
🚀 Installation
npm install watchup-rn
# or
yarn add watchup-rn🛠️ Usage
Wrap your application with the WatchupProvider. It will automatically capture all unhandled JavaScript errors and fatal app crashes.
import { WatchupProvider } from 'watchup-rn';
const App = () => {
return (
<WatchupProvider
projectId="your-project-id"
apiKey="your-api-key"
baseUrl="https://watchup.space"
>
<MainApp />
</WatchupProvider>
);
};🎯 Features
- Automatic Error Capture: Captures JS runtime errors and fatal crashes using React Native's global error system.
- Silent Failure: The SDK is designed to never crash your app, even if reporting fails.
- Lightweight: Zero external dependencies (other than Peer dependencies).
- TypeScript Support: Full type definitions included.
- Universal: Works with Bare React Native and Expo.
⚙️ Configuration
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| projectId | string | Required | Your Watchup project identifier. |
| apiKey | string | Required | Your Watchup API key. |
| baseUrl | string | https://watchup.space | Base URL for the Watchup API. |
🧠 Manual Capture
You can also use the WatchupClient directly via context or hooks if you need to capture handled errors.
import { useWatchup } from 'watchup-rn';
const MyComponent = () => {
const watchup = useWatchup();
const handleError = (error) => {
watchup?.captureError(error, { isFatal: false });
};
return <Button onPress={() => {
try {
// some logic
} catch (e) {
handleError(e);
}
}} title="Test" />;
};⚖️ License
MIT
