Breadcrumb
SDKsTypeScript SDK

Installation

Install

npm install @breadcrumb-sdk/core

Initialize

import { init } from "@breadcrumb-sdk/core";

const bc = init({
  apiKey: process.env.BREADCRUMB_API_KEY!,
  baseUrl: process.env.BREADCRUMB_BASE_URL!,
});
OptionDescription
apiKeyYour project API key
baseUrlYour Breadcrumb instance URL
environmentOptional environment label (e.g. "production")
batchingOptional batching config (see below)

Batching

By default, spans are sent individually. Enable batching to group them into fewer requests:

const bc = init({
  apiKey: process.env.BREADCRUMB_API_KEY!,
  baseUrl: process.env.BREADCRUMB_BASE_URL!,
  batching: {
    maxBatchSize: 10,
    flushIntervalMs: 1000,
  },
});
OptionDefaultDescription
maxBatchSize10Max spans per batch request
flushIntervalMs1000How often to flush the batch (ms)

On this page