Integrations · Next.js

@leetlytics/sdk for Next.js apps.

Use the NPM package for page views, product events, and fetch breakage tracking. Day zero is a few lines of client code — not an analytics warehouse project.

SDK surface

Page views, events, and breakages.

  • createLeetLyticsClient with a public workspace key and ingest endpoint
  • Page views and trackEvent for key product moments
  • installFetchBreakageTracking for 400/500-class request failures
  • Optional server-side POST /api/conversions with a private conversion key
pnpm add @leetlytics/sdk

import { createLeetLyticsClient, installFetchBreakageTracking } from "@leetlytics/sdk";

export const leetlytics = createLeetLyticsClient({
  workspaceKey: process.env.NEXT_PUBLIC_LEETLYTICS_WORKSPACE_KEY!,
  endpoint: "https://leet.fyi/api/ingest",
});

if (typeof window !== "undefined") {
  installFetchBreakageTracking(leetlytics);
  // SDK clients do not auto-send page views — fire day-zero signal explicitly:
  void leetlytics.trackEvent({ name: "page_view" });
}
Out of scope for day zero

Keep the client surface small.

  • Automatic GTM container wiring
  • Session replay or full APM traces
  • Warehouse export connectors on day zero