buster/packages/sdk
Nate Kelley de54e28f2e
Added output for the builds
2025-09-23 22:40:45 -06:00
..
scripts sdk and ts cli 2025-08-27 15:53:53 -06:00
src Implement unified deployment for models and docs 2025-09-09 00:32:48 -06:00
.gitignore sdk and ts cli 2025-08-27 15:53:53 -06:00
README.md sdk and ts cli 2025-08-27 15:53:53 -06:00
biome.json sdk and ts cli 2025-08-27 15:53:53 -06:00
env.d.ts sdk and ts cli 2025-08-27 15:53:53 -06:00
package.json Added better formatting for cli package and updated versions to match workspace 2025-09-05 11:39:43 -06:00
tsconfig.json sdk and ts cli 2025-08-27 15:53:53 -06:00
turbo.json Added output for the builds 2025-09-23 22:40:45 -06:00
vitest.config.ts sdk and ts cli 2025-08-27 15:53:53 -06:00

README.md

@buster/sdk

Minimal TypeScript SDK for the Buster API.

Installation

pnpm add @buster/sdk

Usage

import { createBusterSDK } from '@buster/sdk';

const sdk = createBusterSDK({
  apiKey: 'your-api-key',
  apiUrl: 'https://api.buster.so', // optional
});

// Test connection
const health = await sdk.healthcheck();
console.log('Server status:', health.status);

Configuration

interface SDKConfig {
  apiKey: string;           // Required
  apiUrl?: string;          // Default: 'https://api.buster.so'
  timeout?: number;         // Default: 30000ms
  retryAttempts?: number;   // Default: 3
  retryDelay?: number;      // Default: 1000ms
  headers?: Record<string, string>; // Optional custom headers
}

Error Handling

import { SDKError, NetworkError } from '@buster/sdk';

try {
  await sdk.healthcheck();
} catch (error) {
  if (error instanceof NetworkError) {
    console.error('Connection failed:', error.message);
  } else if (error instanceof SDKError) {
    console.error('API error:', error.statusCode, error.message);
  }
}