UNPKG

knotapi-js

Version:

Provide a seamless way for end users to link their merchant accounts to your web app.

54 lines (53 loc) 1.59 kB
import "./index.css"; export declare type KnotError = { errorCode: string; errorDescription: string; product?: 'card_switcher' | 'transaction_link' | 'link'; }; export declare type KnotEvent = { event: string; merchant?: string; merchantId?: string; metaData?: Record<string, unknown>; product?: 'card_switcher' | 'transaction_link' | 'link'; taskId?: string; environment?: 'production' | 'sandbox' | 'development'; }; export declare type KnotSuccess = { merchant: string; product?: 'card_switcher' | 'transaction_link' | 'link'; }; export declare type KnotExit = { product?: 'card_switcher' | 'transaction_link' | 'link'; }; declare type CommonConfig = { sessionId?: string; clientId: string; merchantIds?: number[]; environment: 'production' | 'sandbox' | 'development'; product?: 'card_switcher' | 'transaction_link'; useCategories?: boolean; useSearch?: boolean; entryPoint?: string; mode?: 'headless' | 'ui'; slug?: string; platform?: string; customerName?: string; cardName?: string; logoId?: number; onSuccess?: (knotSuccess: KnotSuccess) => void; onError?: (knotError: KnotError) => void; onEvent?: (knotEvent: KnotEvent) => void; onExit?: (knotExit: KnotExit) => void; authToken?: string; }; declare class KnotapiJS { constructor(); private startKnotProduct; open: (config: CommonConfig) => void; private sendDataToIframe; private getUrlForEvent; private callIdentifyUser; private callTrackEvent; } export default KnotapiJS;