spryngtime-analytics-sdk
v1.1.6
Published
Client for Spryngtime Usage Analytics & Billing API
Downloads
5
Maintainers
Readme
spryngtime-analytics-sdk
Spryngtime Usage Analytics & Billing API
Table of Contents
Installation
npm i spryngtime-analytics-sdk
pnpm i spryngtime-analytics-sdk
yarn add spryngtime-analytics-sdk
Getting Started
import { SpryngtimeAnalyticsSdk } from "spryngtime-analytics-sdk";
const spryngtimeanalyticssdk = new SpryngtimeAnalyticsSdk({
// Defining the base path is optional and defaults to http://localhost
// basePath: "http://localhost",
apiKey: "API_KEY",
});
const trackUsageResponse =
await spryngtimeanalyticssdk.usageTracking.trackUsage({
user: "user_example",
});
console.log(trackUsageResponse);
Reference
spryngtimeanalyticssdk.usageTracking.trackUsage
Track usage data
🛠️ Usage
const trackUsageResponse =
await spryngtimeanalyticssdk.usageTracking.trackUsage({
user: "user_example",
});
⚙️ Parameters
user: string
query: string
conversationId: string
latency: number
customProperties: { [key: string]: any; }
openAiResponse: OpenAiResponse
usage: UsageDetail
🌐 Endpoint
/trackUsage
POST
spryngtimeanalyticssdk.default.rootGet
Home
🛠️ Usage
const rootGetResponse = await spryngtimeanalyticssdk.default.rootGet();
🌐 Endpoint
/
GET
spryngtimeanalyticssdk.default.usersPost
Adds a new user
🛠️ Usage
const usersPostResponse = await spryngtimeanalyticssdk.default.usersPost({
id: 10,
name: "Jessica Smith",
});
⚙️ Parameters
id: number
name: string
🌐 Endpoint
/users
POST
Author
This TypeScript package is automatically generated by Konfig