Skip to main content

Quick Integration for React-Native Logs

1. Installation with NPM

Shipbook is available through: NPM

npm i @shipbook/react-native

2. Initializing ShipBook into your code

To initialize shipbook, add the following:

  import shipbook from '@shipbook/react-native';

shipbook.start("YOUR_APP_ID", "YOUR_APP_KEY");

3. Adding logs

To have a log on each class you need to create a logger:

  import shipbook from '@shipbook/react-native';

let log = shipbook.getLogger("MODULE_NAME");

The usage of the log:

  log.e("the log message"); // Error log
log.w("the log message"); // Warning log
log.i("the log message"); // Info log
log.d("the log message"); // Debug log
log.v("the log message"); // Verbose log

4. Run your app to verify installation.