SDK Overview
Bklit Analytics SDK - Track page views, sessions, and user behavior
SDK Overview
The Bklit Analytics SDK is a lightweight JavaScript library for tracking analytics in your web applications.
⚠️ Upgrading from v0.x to v1.0.0? See the Migration Guide for breaking changes and upgrade instructions.
Features
- Automatic Tracking - Page views and sessions tracked automatically
- Custom Events - Track user interactions and conversions
- SPA Support - Works with single-page applications
- Privacy-First - No cookies, GDPR compliant
- Lightweight - Minimal performance impact
- TypeScript - Full TypeScript support
Installation
npm install @bklit/sdkpnpm add @bklit/sdkQuick Start
Vanilla JavaScript / React
import { initBklit } from '@bklit/sdk';
initBklit({
projectId: 'your-project-id',
apiKey: 'your-api-key',
});Next.js
import { BklitComponent } from '@bklit/sdk/nextjs';
export default function RootLayout({ children }) {
return (
<html>
<body>
<BklitComponent
projectId="your-project-id"
apiKey="your-api-key"
/>
{children}
</body>
</html>
);
}Related Documentation
- Migration to v1.0.0 - Upgrade guide from v0.x
- Installation - Detailed installation guide
- Vanilla JS - Using with vanilla JavaScript
- Next.js - Next.js integration
- Configuration - Configuration options
- Geolocation - Setting up geolocation with Cloudflare
- Debug Mode - Debugging and logging
- Event Tracking - Tracking custom events
- API Reference - Complete API documentation