Browser SDK

If you're building a chatbot app on the web, we provide a browser SDK to help you record conversations and track user feedback.

1

Install the package

Install the package from NPM:

npm install llmonitor

In your frontend code, initialize the SDK with your app ID:

import monitor from "llmonitor/browser"
monitor.init({
appId: "YOUR APP ID",
})
2

Track a user message and bot reply

Next, you can use the monitor object to track user messages and bot replies:

const id = monitor.trackUserMessage("Hello")
monitor.trackBotMessage(id, "Hi there, how can I help you?")
3

Track a user feedback

Finally, you can track user feedback on the bot replies:

The ID is the same as the one returned by trackUserMessage.

monitor.trackFeedback(id, { thumbs: up })

More

Questions? We're here to help.