@uluops/sdk-core

Shared infrastructure for UluOps SDKs — HTTP client, authentication strategies, error classes, configuration loading, and utilities.

v0.13.0

Installation

npm install @uluops/sdk-core

Quick Start

TypeScript
import { HttpClient } from '@uluops/sdk-core';

const client = new HttpClient({
  apiKey: 'ulr_your-api-key',
});

Constructor Parameters

baseUrlrequiredstring

Base URL for API requests. Must use HTTPS for non-loopback targets (localhost/127.0.0.1 exempt).

sdkNamerequiredstring

SDK name for User-Agent header (e.g., '@uluops/ops-sdk').

sdkVersionrequiredstring

SDK version for User-Agent header.

loggerPrefixrequiredstring

Logger prefix for debug output (e.g., '[ops-sdk:http]').

authBaseUrloptionalstring

Separate base URL for auth endpoints (when auth is delegated to a different API). Must use HTTPS for non-loopback targets.

timeoutoptionalnumber

Request timeout in milliseconds.

Default: 30000
retriesoptionalnumber

Max retry attempts for transient errors.

Default: 3
debugoptionalboolean

Enable debug logging.

defaultHeadersoptionalRecord<string, string>

Extra default headers sent with every request.

apiKeyoptionalstring

API key for authentication.

emailoptionalstring

Email for session-based authentication.

passwordoptionalstring

Password for session-based authentication.

sessionTokenoptionalstring

Pre-existing session token.

onTokenRefreshoptional(token: string) => void

Callback invoked when session token is automatically refreshed.

Subpath Exports

  • @uluops/sdk-core/httpHttpClient class
  • @uluops/sdk-core/errorsError classes and type guards
  • @uluops/sdk-core/configConfiguration loading utilities
  • @uluops/sdk-core/config/constantsSDK constants (timeouts, prefixes, status codes)
  • @uluops/sdk-core/utilsUtility functions (retry, sleep, isUuid, logger)

Namespaces