chatsee-sdk
v2.0.0
Published
Production-grade tracker for LLM conversations, tool calls, and errors for the Chatsee platform
Downloads
107
Maintainers
Readme
Chatsee SDK (JavaScript / TypeScript)
Installation
npm i chatsee-sdkEnvironment deployment (QA / Demo / GCP)
The SDK supports one package and you select the environment by setting api_base_url to an alias: "qa" | "demo" | "gcp".
Classifiers source (redaction)
By default, the SDK always fetches redaction classifiers from QA (qa) regardless of the selected environment.
QA
- Alias:
qa→https://qa-api.chatsee.ai:8000 - Interaction endpoint:
/v1/api/process_interaction - Classifiers endpoint:
/v1/redaction/fetch-classifiers - API docs:
qa process_interaction,qa redaction classifiers
Demo
- Alias:
demo→https://demo-api.chatsee.ai:8000 - Interaction endpoint:
/v1/api/process_interaction - Classifiers endpoint:
/v1/redaction/fetch-classifiers - API docs:
demo process_interaction
GCP QA
- Alias:
gcp→https://gcp-qa.chatsee.ai/api - Interaction endpoint:
/v1/api/process_interaction - Classifiers endpoint:
/v1/redaction/fetch-classifiers
Usage (tracking)
import { ChatseeTracker } from "chatsee-sdk";
const tracker = new ChatseeTracker({
agent_id: "agent_1",
user_id: "user_1",
tenant_id: "tenant_1",
tenant_name: "Tenant 1",
chatsee_api_key: "YOUR_API_KEY",
// Pick environment:
api_base_url: "qa",
// api_base_url: "demo",
// api_base_url: "gcp",
// Optional: locally redact payload before sending
redaction: {
enabled: true,
fields_to_redact: "*", // or ["user_message","bot_message","metadata",...]
},
});
tracker.startTurn("My email is [email protected]", { any: "metadata" });
await tracker.endTurn("Thanks!");Usage (redaction as an SDK feature)
Module-level redact()
import { redact } from "chatsee-sdk";
const redacted = await redact(
{ message: "Card 4111 1111 1111 1111", email: "[email protected]" },
{
api_base_url: "qa",
fields_to_redact: "*",
}
);Tracker instance tracker.redact()
const redacted = await tracker.redact(
{ user_message: "Phone +1 (555) 123-4567" },
{ fields_to_redact: "*" }
);Encryption
Encryption support has been removed from this SDK.
