UNPKG

zipyai

Version:

SDK for zipy

99 lines (98 loc) 3.8 kB
import * as types from "./zipy-types"; /** * init sdk corresponding * @param sdkKey Key to identify sdk customer * @param debugLogs to print logs */ export declare const init: (sdkKey: string, options?: Partial<types.options>) => Promise<void>; /** * To identify end user identity * @param externalUUId uuid of the end user * @options to get optional details of user */ export declare const identify: (externalUUId: string, userInfo?: any) => void; /** * To anonymize end user on logout */ export declare const anonymize: () => void; /** * This function will return the current session url * @returns url */ export declare const getCurrentSessionURL: (options?: { withCurrentTimestamp: boolean; }) => string; export declare const getCurrentSessionURLAsync: (options?: { withCurrentTimestamp: boolean; }) => Promise<string>; /** * @param {string} message * @param {types.zipyEventOptions} options? * This method allows customers to log custom messages. */ export declare const logMessage: (message: string, options?: types.zipyEventOptions) => void; /** * @param {unknown} err * This method allows customers to log exceptions that are handled by user but want to capture in Zipy */ export declare const logException: (err: unknown) => void; /** * @param {string} name * @param {string} message * @param {string} category? * @param {types.zipyEventOptions} options? * This method allows user to add custom errors that customers can log for handling errors. */ export declare const logError: (name: string, message: string, category?: string, options?: types.zipyEventOptions) => void; /** * This function will return the utm search params * @returns UTMParams */ export declare const extractUTMParameters: () => string[]; /** * Sends an alert message to Slack with the provided title and message. * * @param {string} title - The title of the alert. * @param {string} message - The message content of the alert. * * @throws Will log an error if there is an issue sending the alert. * * @remarks * - The function retrieves SDK configuration data and checks if live user alerts are enabled. * - If either the title or message is missing, the function returns early. * - The function gathers session and user information to include in the alert data. * - The alert data is sent using the `sendDataOnSDKSessionManager` function. * * @example * ```typescript * sendAlertOnSlack('Alert Title', 'This is an alert message.'); * ``` */ export declare const sendAlertOnSlack: (title: string, message: string) => void; export declare const record: types.recordTypes; /** * function to send user's custom event * @param event_name * @param event_properties * @returns */ export declare const logEvent: (eventName: string, properties?: types.CustomEventProperties) => void; declare const _default: { init: (sdkKey: string, options?: Partial<types.options>) => Promise<void>; identify: (externalUUId: string, userInfo?: any) => void; anonymize: () => void; getCurrentSessionURL: (options?: { withCurrentTimestamp: boolean; }) => string; logError: (name: string, message: string, category?: string, options?: types.zipyEventOptions) => void; logException: (err: unknown) => void; logMessage: (message: string, options?: types.zipyEventOptions) => void; logEvent: (eventName: string, properties?: types.CustomEventProperties) => void; extractUTMParameters: () => string[]; record: types.recordTypes; sendAlertOnSlack: (title: string, message: string) => void; getCurrentSessionURLAsync: (options?: { withCurrentTimestamp: boolean; }) => Promise<string>; }; export default _default;