watchtower-node-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

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

npm install watchtower-node-sdk

Quick Start

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.

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

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Run linter
npm run lint

License

MIT

Package Sidebar

Install

npm i watchtower-node-sdk

Weekly Downloads

14

Version

1.1.3

License

MIT

Unpacked Size

193 kB

Total Files

108

Last publish

Collaborators

  • noahsjursen