1.0.0 • Published 10 months ago

@leather.io/analytics v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@leather/analytics

This package provides a client for sending analytics events to various analytics services. Currently, it supports Segment but could be extended to support other services in the future.

Installation

pnpm install @leather/analytics

Usage

Before making any analytics calls, you must configure the analytics client with your write key.

import { AnalyticsClientType, configureAnalyticsClient } from '@leather.io/analytics';

export const analytics: AnalyticsClientType = configureAnalyticsClient({
  client: segmentClient,
  defaultProperties: {
    platform: 'mobile',
  },
});

Now you can make analytics calls with your configured client.

import { analytics } from 'path/to/analytics';

analytics.track('My Event', {
  property: 'value',
});

Development

pnpm build

or

pnpm build:watch
1.0.0

10 months ago

0.0.1

10 months ago