0.1.0 • Published 1 year ago

@watchcathq/watchcat-sdk-js v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

npm.io watchcat-sdk-js

Official Javascript SDK for watchcat.io.

Installation and Usage

Install the package using your preferred package manager:

npm install @watchcathq/watchcat-sdk-js
yarn add @watchcathq/watchcat-sdk-js

Set up the package by importing it and initializing it with your application token:

import WatchCat from "@watchcathq/watchcat-sdk-js";

WatchCat.init({
    apiToken: "APP_TOKEN",
})

Now you can start sending logs and exceptions:

WatchCat.warn('Warning message!')
WatchCat.error('Warning message!')

try {
    const res = yourService.call(data)
} catch (e) {
    WatchCat.exception(e)
}

Express integration

You can catch express errors by using the error handler:

app.use(WatchCat.expressErrorHandler)

Note: Your error handlers should always be at the end of your application!

Documentation

See https://watchcat.io/docs

0.1.0

1 year ago