SDK Overview
Statly Observe SDKs capture errors, exceptions, and events from your applications. Track issues across your stack with consistent APIs.
Available SDKs
| Language | Package | Install |
|---|---|---|
| JavaScript/Node.js | @statly/observe (opens in a new tab) | npm install @statly/observe |
| Python | statly-observe (opens in a new tab) | pip install statly-observe |
| Go | statly-go (opens in a new tab) | go get github.com/KodyDennon/statly-go |
Quick Comparison
| Feature | JavaScript | Python | Go |
|---|---|---|---|
| Auto error capture | Yes | Yes | Via Recover() |
| Console integration | Yes | Yes | N/A |
| HTTP middleware | Express, Fastify, Next.js | Flask, Django, FastAPI | Gin, Echo, net/http |
| Async support | Native | Native | Goroutines |
| Source maps | Yes | N/A | N/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:
| Level | Description |
|---|---|
debug | Debugging information |
info | Informational messages |
warning | Warning conditions |
error | Error conditions |
fatal | Critical 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: