Tracking
Javascript
The Javascript SDK serves the purpose of sending explicit user actions and feedback to the Nebuly platform.
An example of these actions might be thumbs_up
, thumbs_down
, copy_input
, copy_output
.
You can only use the client-side SDK in conjunction with the server-side SDK. Please make sure to integrate a server-side SDK first and then complement it with a with a client-side one to track explicit user behavior.
Installation
Method 1: Automatic tracking
Some of the user actions can be automatically tracked from the UI elements.
User action | Description |
---|---|
Copy input | The user has copied either a portion or the entire input prompt |
Copy output | The user has copied either a portion or the entire answer of the LLM |
Paste to input | The user has pasted text into the input prompt |
Given this UI:
We can configure the sdk to attach listeners to the chatbox and automatically track actions based on the event and the item it fired on.
Method 2: Custom events
You can also create custom events to track to Nebuly. For example, if you have a button that generates a new response or thumbs up/down, you can track that action as follows: