API Reference
Boundary Class

Boundary Class

The main entry point for the SDK.

Constructor

new Boundary(config: BoundaryConfig, adapters?: Map<string, ProviderAdapter>)

Parameters

  • config - Configuration object for all providers
  • adapters - Optional custom provider adapters

Example

const boundary = new Boundary({
  providers: {
    github: { auth: { token: "ghp_..." } },
    stripe: { auth: { apiKey: "sk_..." } }
  }
});

Methods

getCircuitStatus(provider: string): CircuitBreakerStatus | null

Returns the current circuit breaker status for a provider.

Returns: "closed" | "open" | "half-open" | null

const status = boundary.getCircuitStatus("github");

registerProvider(name: string, adapter: ProviderAdapter, config: ProviderConfig): void

Dynamically register a new provider at runtime.

Parameters

  • name - Unique provider identifier
  • adapter - Provider adapter implementation
  • config - Provider configuration
boundary.registerProvider("custom", customAdapter, {
  auth: { apiKey: "..." }
});