customerio-node
Version:
A node client for the Customer.io event API. http://customer.io
30 lines (29 loc) • 1.69 kB
TypeScript
/// <reference types="node" />
import type { RequestOptions } from 'https';
import Request, { BasicAuth, RequestData, PushRequestData } from './request';
import { Region } from './regions';
import { IdentifierType } from './types';
type TrackDefaults = RequestOptions & {
region: Region;
url?: string;
};
export declare class TrackClient {
siteid: BasicAuth['siteid'];
apikey: BasicAuth['apikey'];
defaults: TrackDefaults;
request: Request;
trackRoot: string;
constructor(siteid: BasicAuth['siteid'], apikey: BasicAuth['apikey'], defaults?: Partial<TrackDefaults>);
identify(customerId: string | number, data?: RequestData): Promise<Record<string, any>>;
destroy(customerId: string | number): Promise<Record<string, any>>;
suppress(customerId: string | number): Promise<Record<string, any>>;
unsuppress(customerId: string | number): Promise<Record<string, any>>;
track(customerId: string | number, data?: RequestData): Promise<Record<string, any>>;
trackAnonymous(anonymousId: string | number, data?: RequestData): Promise<Record<string, any>>;
trackPageView(customerId: string | number, path: string): Promise<Record<string, any>>;
trackPush(data?: PushRequestData): Promise<Record<string, any>>;
addDevice(customerId: string | number, device_id: string, platform: string, data?: Record<string, any>): Promise<Record<string, any>>;
deleteDevice(customerId: string | number, deviceToken: string | number): Promise<Record<string, any>>;
mergeCustomers(primaryIdType: IdentifierType, primaryId: string | number, secondaryIdType: IdentifierType, secondaryId: string | number): Promise<Record<string, any>>;
}
export {};