Circle V2 API Docs
    Preparing search index...

    Module @repo/analytics-core

    @repo/analytics-core

    @repo/analytics-core is a framework-agnostic analytics interface. It exports an abstract AnalyticsClient class with initialize(), identify(userId, properties), and trackEvent(event, properties?) methods, plus the AnalyticsEvent type. It also ships a LoggerAnalyticsClient default implementation that logs analytics calls through @repo/logger (useful for development).

    %%{init:{"theme":"dark"}}%% flowchart LR analyticsCore["@repo/analytics-core"] logger["@repo/logger"] ts["@repo/typescript-config"] vitest["@repo/vitest-config"] analyticsCore -.-> logger analyticsCore -.-> ts analyticsCore -.-> vitest
    %%{init:{"theme":"default"}}%% flowchart LR analyticsCore["@repo/analytics-core"] logger["@repo/logger"] ts["@repo/typescript-config"] vitest["@repo/vitest-config"] analyticsCore -.-> logger analyticsCore -.-> ts analyticsCore -.-> vitest
    flowchart LR
      analyticsCore["@repo/analytics-core"]
      logger["@repo/logger"]
      ts["@repo/typescript-config"]
      vitest["@repo/vitest-config"]
      analyticsCore -.-> logger
      analyticsCore -.-> ts
      analyticsCore -.-> vitest
    import { AnalyticsClient } from "@repo/analytics-core";

    class MixpanelClient extends AnalyticsClient {
    async initialize() {
    /* ... */
    }
    async identify(userId: string, properties: Record<string, unknown>) {
    /* ... */
    }
    async trackEvent(event: string, properties?: Record<string, unknown>) {
    /* ... */
    }
    }

    Or use the built-in logger client for development:

    import { loggerAnalyticsClient } from "@repo/analytics-core";

    await loggerAnalyticsClient.trackEvent("page_view", { page: "/dashboard" });
    Script Description
    test Run Vitest with coverage
    test:watch Run Vitest in watch mode
    check-types Typecheck with tsc --noEmit

    Classes

    AnalyticsClient
    LoggerAnalyticsClient

    Type Aliases

    AnalyticsEvent

    Variables

    loggerAnalyticsClient