Installation
Choose the right Klime SDK for your platform and get started.
JavaScript (Browser)
React, Vue, Next.js
JavaScript (Node.js)
Express, Fastify, NestJS
Python
Django, Flask, FastAPI
Go
Standard library, Gin, Echo
Ruby
Rails, Sinatra
PHP
Laravel, Symfony
Java
Spring Boot, Jakarta EE
Elixir
Phoenix, Plug, LiveView
Frontend or backend?
Frontend tracking — Use the JavaScript browser SDK for any client-side tracking, both for dynamic or static sites. It automatically captures browser context (userAgent, locale, timezone) and handles page unload events.
Backend tracking — Use a server SDK for server-rendered apps, API servers, background jobs, or webhook handlers.
Common features
All SDKs share the same core API design (track, identify, group) while following platform-specific conventions:
- Automatic batching — Events are queued and sent in batches for efficiency
- Automatic retries — Failed requests retry with exponential backoff
- Graceful shutdown — Events are flushed before process exit
- Zero dependencies — Built on standard library only
- Type safety — Full TypeScript/type hints support
Configuration
All SDKs accept similar configuration options:
| Option | Default | Description |
|---|---|---|
writeKey | (required) | Your Klime write key |
endpoint | https://i.klime.com | API endpoint |
flushInterval | 2 seconds | Time between automatic flushes |
maxBatchSize | 20 events | Max events per batch (max: 100) |
maxQueueSize | 1000 events | Max queued events |
retryMaxAttempts | 5 | Max retry attempts |
Zero Performance Impact
All tracking methods are non-blocking. Events are queued in memory and sent in the background. Your application code is never blocked by network requests.
Tip: Use environment variables
Never commit your write key to source control. Store it in an environment variable like KLIME_WRITE_KEY and load it at runtime.