SDKs
Official Incidion SDKs for Python, JavaScript/TypeScript and Go, and what each one does.
The SDKs send logs, exceptions and metrics to Incidion, ping heartbeat monitors from jobs and report deployments from CI. They batch in the background, retry when the ingest is busy, and never block your request path on delivery.
| SDK | Runtimes | Page |
|---|---|---|
Python (incidion) |
Python 3.9+, no required dependencies | Python |
JavaScript / TypeScript (@incidion/sdk) |
Node.js 18+, Bun, Deno, browsers, Cloudflare Workers, Vercel Edge; no dependencies | JavaScript |
Go (github.com/nad3rk/incidion/sdks/go) |
Go 1.21+; one dependency (go.opentelemetry.io/otel/trace) |
Go |
Any other language: send logs with OpenTelemetry or the JSON API.
Features
| Python | JavaScript | Go | |
|---|---|---|---|
| Logs (all ingest columns, free-form attributes) | client.info(...) |
incidion.info(...) |
client.Info(ctx, ...) |
| Exceptions with stack trace | capture_exception |
captureException (with cause chain) |
CaptureError |
| Tags, user, release, environment | set_tags, set_user, release, environment_id |
setTags, setUser, release, environmentId |
SetTags, SetUser, Release, EnvironmentID |
| Change or drop logs before sending | before_send |
beforeSend |
BeforeSend |
| Sampling (errors always kept) | sample_rate |
sampleRate |
SampleRate |
| OpenTelemetry trace correlation | with incidion[otel] |
when @opentelemetry/api 1.x is in use |
from the context.Context |
| Metrics | metric |
metric |
Metric |
| Heartbeats | send_heartbeat, @heartbeat decorator |
heartbeat, withHeartbeat |
Heartbeat, Job |
| Deployments | deployment_start / deployment_finish |
deploymentStart / deploymentFinish |
DeploymentStart / DeploymentFinish |
| Logging integration | logging handler (IncidionHandler) |
none (call the client) | log/slog handler |
| Uncaught errors | no | captureUncaught: true |
no |
| Durations in options | seconds (float) |
milliseconds | time.Duration |
All three use the same configuration names in the environment (INCIDION_API_KEY, INCIDION_SECRET_KEY, INCIDION_PROJECT_ID, INCIDION_BASE_URL, INCIDION_API_URL, INCIDION_SERVICE, INCIDION_ENVIRONMENT_ID, INCIDION_RELEASE), the same defaults (flush every 5 seconds, 50 entries per request, 10,000 entries queued, 5 retries, retry waits capped at 300 seconds), and the same delivery rules.
Keys
Each project has two keys (Settings > API Keys):
| Key | Option | Used for | Where it may live |
|---|---|---|---|
Public pk_... |
api_key / apiKey / APIKey |
Logs, metrics, heartbeats addressed by monitor UUID | Servers, workers, browsers, mobile apps |
Secret sk_... |
secret_key / secretKey / SecretKey |
Deployments only | CI secrets and trusted servers. Never in a browser bundle or a mobile app |
The ingest service accepts only pk_ keys. An sk_ key sent to it gets 401, so every SDK warns at startup when the sk_ key is passed as the API key and drops logs and metrics instead of sending them. A CI job that only reports deployments needs just the secret key.
Heartbeat URLs (https://api.incidion.dev/api/v1/heartbeat/hb_.../) and their hb_ tokens need no key at all.
Install status
The SDKs are not yet on the package registries:
- Python: install from GitHub,
pip install "incidion @ git+https://github.com/nad3rk/incidion.git#subdirectory=backend/incidion-sdk". A release on PyPI (pip install incidion) follows. - JavaScript: build from a clone of the repository and install the folder or a tarball (see JavaScript). The npm release (
@incidion/sdk) comes later. - Go:
go get github.com/nad3rk/incidion/sdks/goworks once the tagsdks/go/v0.1.0exists. Until then use areplacedirective (see Go).
Other languages
Every OpenTelemetry SDK can export logs to Incidion over OTLP/HTTP: Java, .NET, Go, Node.js, Python, Ruby, PHP, Rust and the OpenTelemetry Collector. See OpenTelemetry. Without OpenTelemetry, post JSON to the ingest API directly (Send Logs).