Skip to main content
Openfuse
Guides

Configuration

All client options for cloud and self-hosted deployments

OpenfuseCloud (managed)

Connect to Openfuse's managed service at https://api.openfuse.io.

import { OpenfuseCloud } from '@openfuseio/sdk'

const openfuse = new OpenfuseCloud({
  system: 'payments',
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
})

Options

OptionTypeRequiredDescription
systemstringYesSystem slug that groups related breakers. Created in the dashboard.
clientIdstringYesSDK client ID from the dashboard.
clientSecretstringYesSDK client secret from the dashboard.
metricsPartial<TMetricsConfig>NoOverride default metrics settings. See Metrics configuration.
instanceIdstringNoCustom instance ID for metrics deduplication. Auto-detected if omitted. See Production.

Openfuse (self-hosted)

Connect to your own Openfuse API deployment.

import { Openfuse } from '@openfuseio/sdk'

const openfuse = new Openfuse({
  baseUrl: 'https://openfuse.your-domain.com',
  system: 'payments',
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
})

Options

OptionTypeRequiredDescription
baseUrlstringYesYour Openfuse API base URL.
systemstringYesSystem slug that groups related breakers.
clientIdstringYesSDK client ID.
clientSecretstringYesSDK client secret.
metricsPartial<TMetricsConfig>NoOverride default metrics settings.
instanceIdstringNoCustom instance ID for metrics deduplication.

Metrics configuration

Metrics defaults come from the server. Override any of them:

OptionTypeDefaultDescription
windowSizeMsnumber10000Aggregation window in milliseconds.
flushIntervalMsnumber15000How often to flush metrics to the backend.
maxLatencySamplesnumber1000Max latency samples per window for percentile calculation.
enabledbooleantrueSet to false to disable metrics collection.
const openfuse = new OpenfuseCloud({
  system: 'payments',
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  metrics: {
    flushIntervalMs: 30_000,
    enabled: true,
  },
})

Secrets and environment variables

Keep clientId and clientSecret out of source code. Use your platform's secret management (environment variables, AWS Secrets Manager, Vault).

The SDK doesn't read environment variables directly. Load credentials from your environment or secret manager at runtime and pass them to the constructor.

Init options

Control the bootstrap process:

openfuse.init({
  timeoutMs: 5000,
  maxAttempts: 3,
})

On this page