← All packages

@lacspace/analytics

v2.1.0Core1 @lacspace dep

Event tracking for Lacspace platforms — a spec-style track/identify/page/group/alias client with batching, an offline retry queue, consent + Do-Not-Track gating, and pluggable middleware. Every transport, clock and timer is injectable, so it never touches the network by default.

npm i @lacspace/analytics

Usage

analytics.ts
import { LacspaceAnalytics } from "@lacspace/analytics";

const analytics = new LacspaceAnalytics({ baseURL: "https://api.lacspace.com/api" });

await analytics.track("product_viewed", { id: "p_123", price: 499 });

Exports 2

LacspaceAnalyticscreateAnalytics

Keywords

lacspaceanalyticstrackingeventstypescriptweb-analytics

More in Core

@lacspace/analytics-lite

Privacy-first, cookieless web analytics — page views and custom events sent to your own endpoint. No cookies, no localStorage IDs, no cross-site tracking, no consent banner. Respects Do-Not-Track, auto-tracks SPA navigation, uses sendBeacon. Now with a batching LiteClient, a sendBeacon-first transport, UTM parsing, DNT/consent helpers and a CSPRNG id. Zero-dependency, isomorphic.

@lacspace/api

Lightweight, zero-dependency, isomorphic TypeScript HTTP client for Lacspace APIs — retries with backoff, interceptors, timeouts/abort, page- & cursor-pagination, plus dependency-free query-string, URL/path, header-merge, form-body and typed-error helpers.

@lacspace/auth

Authentication flows (login, register, token, refresh) for Lacspace APIs — now with PKCE/OIDC helpers, JWT expiry math, scope/role checks and proactive token refresh.

@lacspace/next

Next.js App Router integration for the Lacspace SDK — authenticated server client from cookies, Route Handler/Server Action wrappers, CSRF + middleware auth guard, plus edge-safe pure helpers for cookies, Cache-Control, route matching, open-redirect-safe redirects and bearer tokens.

@lacspace/react

React hooks and provider for the Lacspace SDK — useAuth, useQuery, useMutation, useAuthStatus and useLacspace, all sharing one authenticated client, over a pure DOM-free core (async state machine, retry/backoff, polling) you can unit-test anywhere.

@lacspace/sdk

High-level TypeScript SDK for Lacspace — api, auth, analytics and e-commerce sharing one connection and token. Now with named environment presets, a config merger, correlation/idempotency ids, health probes, typed error normalization and transport-agnostic pagination.