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/sdk
pnpm add @bklit/sdk

Quick 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>
  );
}

On this page