UNPKG

741 BTypeScriptView Raw
1/**
2 * @author: JP Lew (jp@cto.ai)
3 * @date: Sunday, 28th April 2019 1:16:46 am
4 * @lastModifiedBy: JP Lew (jp@cto.ai)
5 * @lastModifiedTime: Wednesday, 4th September 2019 3:08:35 pm
6 * @copyright (c) 2019 CTO.ai
7 */
8import Analytics from 'analytics-node';
9import { ApiService } from '../types';
10interface AnalyticsTrack {
11 userId?: string | number;
12 teamId?: string | number;
13 anonymousId?: string | number;
14 event: string;
15 properties?: any;
16 timestamp?: Date;
17 context?: any;
18 integrations?: any;
19}
20export declare class AnalyticsService {
21 segmentClient: Analytics;
22 api: ApiService;
23 constructor(writeKey?: string);
24 track(payload: AnalyticsTrack, accessToken?: string): Analytics | null;
25}
26export {};