@salve-software/salvetron-react-native
v1.1.4
Published
salvetron-react-native is a React Native package built with Nitro
Downloads
948
Readme
salvetron-react-native
React Native SDK for Salvetron - Real-time debugging console for React Native.
Requirements
| Requirement | Version | |-------------|---------| | React Native | 0.73+ | | Node.js | 18+ |
Installation
npm install @salve-software/salvetron-react-native react-native-nitro-modulesFor iOS, install pods:
cd ios && pod install && cd ..For Android, the package will auto-link.
Usage
Add the following code to your app's entry point (e.g., App.tsx):
import Salvetron from '@salve-software/salvetron-react-native';
if (__DEV__) {
Salvetron.connect({
host: '192.168.1.100', // Your Mac's IP address
port: 8765,
enableNetworkCapture: true,
});
}Tip: Use
localhostfor iOS Simulator, or your Mac's local IP for physical devices.
API
Salvetron.connect(config?)
interface SalvetronConfig {
host?: string; // Default: 'localhost'
port?: number; // Default: 8765
enableNetworkCapture?: boolean; // Default: true
ignoredUrls?: RegExp[]; // URL patterns to ignore
onConnect?: () => void;
onDisconnect?: () => void;
onError?: (error: Error) => void;
}Salvetron.disconnect()
Closes the WebSocket connection.
Salvetron.isConnected()
Returns the current connection status.
Logging
Salvetron.log('General message');
Salvetron.debug('Debug info', { userId: 123 });
Salvetron.info('Info message');
Salvetron.warn('Warning message');
Salvetron.error('Error message');Salvetron CLI
This SDK requires the Salvetron CLI running in your terminal to receive and display logs.
For full documentation, visit the main repository.
License
MIT
