@strathberry/klaviyo-client
Version:
(Fork) Klaviyo API client for Node.js and browser
12 lines (11 loc) • 892 B
TypeScript
import { KlaviyoProfile, KlaviyoEvent, KlaviyoIdentifierType } from '..';
export declare class ProfilesKlaviyoApi {
private readonly apiKey;
private readonly token;
constructor(apiKey: string, token: string);
getProfile<T extends Record<string, unknown>>(id: string): Promise<KlaviyoProfile & T>;
getProfileId(identifier: string, identifierType: KlaviyoIdentifierType): Promise<KlaviyoProfile['id']>;
updateProfile<T extends Record<string, unknown>>(id: string, profile: Partial<KlaviyoProfile & T>): Promise<KlaviyoProfile & T>;
getProfileEvents<TP extends Record<string, unknown>, TE extends Record<string, unknown>>(id: string, since?: string): Promise<KlaviyoEvent<TP, TE>[]>;
getProfileEventsByMetric<TP extends Record<string, unknown>, TE extends Record<string, unknown>>(id: string, metricId: string, since?: string): Promise<KlaviyoEvent<TP, TE>[]>;
}