Skip to main content

Quick Integration for Web & SPA Logs

1. Installation with NPM

Shipbook is available through: NPM

npm install @shipbook/browser

2. Initializing ShipBook into your code

To initialize shipbook, add the following:

  import Shipbook from '@shipbook/browser';

await 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/browser';

const 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.