SDKs
Overview

SDK Overview

Statly Observe SDKs capture errors, exceptions, and events from your applications. Track issues across your stack with consistent APIs.

Available SDKs

LanguagePackageInstall
JavaScript/Node.js@statly/observe (opens in a new tab)npm install @statly/observe
Pythonstatly-observe (opens in a new tab)pip install statly-observe
Gostatly-go (opens in a new tab)go get github.com/KodyDennon/statly-go

Quick Comparison

FeatureJavaScriptPythonGo
Auto error captureYesYesVia Recover()
Console integrationYesYesN/A
HTTP middlewareExpress, Fastify, Next.jsFlask, Django, FastAPIGin, Echo, net/http
Async supportNativeNativeGoroutines
Source mapsYesN/AN/A

Core Concepts

DSN (Data Source Name)

All SDKs use a DSN to configure where events are sent:

https://<api-key>@statly.live/<org-slug>

Get your DSN from Dashboard → Settings → SDK Setup.

Events

An event represents something that happened in your application:

  • Exceptions: Captured errors with stack traces
  • Messages: Custom log messages at various levels
  • Breadcrumbs: Trail of actions leading to an event

Levels

Events have severity levels:

LevelDescription
debugDebugging information
infoInformational messages
warningWarning conditions
errorError conditions
fatalCritical errors

Context

Enrich events with context:

  • User: Who experienced the error (id, email, username)
  • Tags: Key-value pairs for filtering
  • Extra: Additional arbitrary data

Breadcrumbs

Breadcrumbs record user actions before an error:

// Automatically captured
SDK initialized → Clicked button → API call → Error
 
// Or manually added
addBreadcrumb({
  category: 'auth',
  message: 'User logged in',
  level: 'info'
});

Transport & Batching

All SDKs use efficient event delivery:

  • Batching: Events queued and sent in batches
  • Flush interval: 5 seconds (configurable)
  • Batch size: 10 events triggers immediate send
  • Retry logic: Exponential backoff on failures
  • No 4xx retries: Client errors are not retried

Sampling

Control event volume with sampling:

init({
  dsn: '...',
  sampleRate: 0.5 // Send 50% of events
});

Event Filtering

Use beforeSend to modify or drop events:

init({
  dsn: '...',
  beforeSend: (event) => {
    // Drop events from bots
    if (event.user?.username === 'bot') {
      return null;
    }
    // Scrub sensitive data
    delete event.extra?.password;
    return event;
  }
});

Framework Integrations

Each SDK provides framework-specific integrations: