Typescript SDK
Integrate Alephant Analytics into your TypeScript & Node.js applications
The official Alephant Analytics TypeScript SDK provides convenient access to the Alephant Analytics API from TypeScript and Node.js applications. It allows you to query telemetry, fetch daily usage series, and retrieve real-time summary statistics for FinOps dashboards.
Installation
Install the SDK via npm, yarn, or pnpm:
Initialization
Import and initialize the client with your Personal Access Token (ALEPHANT_PAT) or a Virtual Key.
Example Usage
Fetching Usage Summaries
Retrieve high-level, daily-aggregate KPIs for a specific window, including comparisons to the previous period.
Retrieving Time-Series Data
Fetch fine-grained time-series metrics over a specified date range.
Error Handling
The SDK throws structured errors for non-2xx API responses, allowing you to gracefully handle authentication, rate limits, or validation errors programmatically.