Node
The following is an example of how to use monitro with sveltekit, this is a simple example and not the best way to use monitro, but it should give you an idea of how to use it.
index.ts
//index.ts
import { Monitro } from 'monitro'
const monitroClient = new Monitro('monitro-dev', API_KEY, { hookExceptions: true, dev: false });
const userData: User = { name: 'jack' }
if (userData.name !== 'james') {
monitroClient.error('Invalid User', 'Users name is not james!', { userData })
}
Monitro's cleint can be used anywhere in node.js but keep it on the server side, you can use this on the clients browser but it is NOT recomended as currently the API key has no protection to abuse, we plan on adding this in the future.