Quickstart
Install SDK
Firstly you need to install one of our SDK's in your application:
Initialise SDK and authenticate with Trubrics
Now ensure that Trubrics is imported & initialised in your app:
Project API key
Your trubrics API key is unique to your project. Login to Trubrics, and copy your project API key from the settings
page. This is a write only API key that allows you to push events.
Track user events (Sign Up, Conversion, etc.)
Track LLM events (Prompts and Generations)
trubrics.trackLLM({
user_id: "user_id",
prompt: "What is Trubrics?",
assistant_id: "gpt-4o",
generation: "Trubrics is the leading product analytics platform for AI applications.",
properties: {
context: "Chat window",
$thread_id: "thread_123" // Trubrics property to group events by conversation thread
},
timestamp: new Date(),
latency: 2
});
trubrics.track_llm(
user_id="user_id",
prompt="What is Trubrics?",
assistant_id="gpt4o",
generation="Trubrics is the leading product analytics platform for AI applications.",
properties={
"$thread_id": "your-thread-id", # special trubrics property to group conversation
"model": "gpt-4",
},
latency=2,
)
For more information on SDK's and how to track events, please refer to the Javascript SDK or Python SDK.