UNPKG

watchtower-node-sdk

Version:

A TypeScript Node.js SDK for the Watchtower API, providing API key management, connection string generation, and more

80 lines (60 loc) 1.86 kB
# Watchtower Node.js SDK A TypeScript Node.js SDK for interacting with the Watchtower API. This SDK provides a simple and type-safe way to manage API keys, generate connection strings, and interact with various Watchtower services. ## Installation ```bash npm install watchtower-node-sdk ``` ## Quick Start ```typescript import { WatchtowerSDK } from 'watchtower-node-sdk'; // Initialize the SDK const sdk = new WatchtowerSDK(); // Roll an API key const rolledKey = await sdk.apikey.rollAPIKey({ current_apikey: 'your_current_key', type: 'organization' // or 'app' or 'tenant' }); // Generate a connection string const connectionString = await sdk.connectionstring.generateConnectionString({ organization_apikey: 'your_org_key', app_apikey: 'your_app_key', tenant_apikey: 'your_tenant_key', // optional expires_in: 3600 // optional: expiration in seconds }); // Parse a connection string const parsedString = await sdk.connectionstring.parseConnectionString( 'your_connection_string' ); ``` ## Documentation For detailed API documentation, including all available endpoints, request/response types, and examples, please refer to [DOCS.md](./DOCS.md). ## Features - TypeScript support with full type definitions - Simple and intuitive API - Built on top of Axios - API Key Management - Roll API keys for organizations, apps, and tenants - Connection String Management - Generate encrypted, time-limited connection strings - Parse and validate connection strings - Additional Endpoints - Health checks - Logs - Metrics - Items - Intelligence - Analysis - App management ## Development ```bash # Install dependencies npm install # Build the project npm run build # Run tests npm test # Run linter npm run lint ``` ## License MIT