import * as _Screeb from "@screeb/sdk-browser"; import { ScreebConfig } from "./screeb-config"; import * as i0 from "@angular/core"; export declare class Screeb { private config; private isInitialized; constructor(config: ScreebConfig); private ensureScreeb; /** * Shutdowns current Screeb session. * * @example * ```ts * this.screeb.close(); * ``` */ close(): Promise; /** * Prints the actual state information of Screeb tag. * * @example * ```ts * this.screeb.debug(); * // ******************* SCREEB SESSION DEBUG ********************* * // Screeb channel id: * // Screeb channel type: widget * // Screeb respondent id: * // Screeb survey id: none * // Screeb response id: none * // * // Screeb current session start: Thu May 04 2023 16:53:49 GMT+0200 (Central European Summer Time) * // Screeb current session last activity: Thu May 04 2023 17:41:30 GMT+0200 (Central European Summer Time) * // * // Screeb targeting engine status: disabled * // Screeb targeting engine: 3 surveys * // * // Detected platform: desktop * // Detected locale: en-GB * // Detected timezone: -120 * // ************************************************************** * ``` */ debug(): Promise; /** * Tracks a user event. * * @param eventName The event name. * @param eventProperties The properties of your event. * ```text Requirements: * - Property names must be limited to 128 characters * - No more than 1000 attributes * - Supported types for values: string, number, boolean and Date. * ``` * * @example * ```ts * this.screeb.eventTrack( * "Product added to cart", * { * product_name: 'Red bike 2021', * category: 'sport', * color: 'red', * price: 299, * count: 1, * reference: '2CF093TG1', * delivery_method: 'UPS', * user_logged: false, * added_at: new Date(), * } * ); * ``` */ eventTrack(eventName: string, eventProperties?: _Screeb.PropertyRecord): Promise; /** * Change the current user identity. * Warning: Running surveys will be closed. * * @param userId The unique identifier of your user. * @param userProperties The properties of your user. * ```text Requirements: * - Property names must be limited to 128 characters * - No more than 1000 attributes * - Supported types for values: string, number, boolean and Date. * ``` * * @example * ```ts * this.screeb.identity( * "", * { * firstname: '', * lastname: '', * plan: '', * last_seen_at: new Date(), * authenticated: true * } * ); * ``` */ identity(userId: string, userProperties?: _Screeb.PropertyRecord): Promise; /** * Retrieves the current user identity. * * @example * ```ts * console.log(await this.screeb.identityGet()); * // { * // channel_id: "", * // anonymous_id: "", * // user_id: "", * // is_ready: true, * // session_id: "", * // session_start: "2023-05-04T16:30:15.882Z", * // session_end: "2023-05-04T17:02:09.087Z", * // } * ``` */ identityGet(): Promise<_Screeb.ScreebIdentityGetReturn>; /** * Assigns the current user to a group. * * @param groupName * @param groupType * @param groupProperties The properties of your user group. * ```text Requirements: * - Property names must be limited to 128 characters * - No more than 1000 attributes * - Supported types for values: string, number, boolean and Date. * ``` * * @example * ```ts * this.screeb.identityGroupAssign( * 'company', * 'Apple', * { * address_line_1: 'Apple Campus', * address_line_2: '1 Infinite Loop', * city: 'Cupertino', * zipcode: 95014, * state: 'California', * country: 'United states', * } * ); * ``` */ identityGroupAssign(groupName: string, groupType?: string, groupProperties?: _Screeb.PropertyRecord): Promise; /** * Unassigns the current user to a group. * * @param groupName The name of your user group. * @param groupType The type of your user group. * * @example * ```ts * this.screeb.identityGroupUnassign('company', 'Apple'); * ``` */ identityGroupUnassign(groupName: string, groupType?: string): Promise; /** * Adds properties to the current user identity. * * @param userProperties The properties of your user. * ```text Requirements: * - Property names must be limited to 128 characters * - No more than 1000 attributes * - Supported types for values: string, number, boolean and Date. * ``` * * @example * ```ts * // Set user properties * this.screeb.identityProperties( * { * firstname: '', * lastname: '', * plan: '', * last_seen_at: new Date(), * authenticated: true * } * ); * * // Delete user property : set values to null * this.screeb.identityProperties( * { * age: null, * company: null, * logged: true, * } * ); * ``` */ identityProperties(userProperties: _Screeb.PropertyRecord): Promise; /** * Resets the current user identity. * Warning: This command must be called only once, since it creates a new identity on Screeb side. * * @example * ```ts * this.screeb.identityReset(); * ``` */ identityReset(): Promise; /** * Interrupts a running survey. * * @example * ```ts * this.screeb.surveyClose(); * ``` */ surveyClose(): Promise; /** * Starts a survey by its ID. * * @example * ```ts * this.screeb.surveyStart( * '', * '', * false, * { // optional * color: "green", * article_id: 42 * }, * { // optional * version: "1.0.0", * onSurveyShowed: (payload) => console.log("Survey showed", payload), * }, * "en", // optional * "#screeb-survey-container" // optional * ); * ``` */ surveyStart(surveyId: string, distributionId: string, allowMultipleResponses: boolean, hiddenFields?: _Screeb.PropertyRecord, hooks?: _Screeb.HooksSurveyStart, language?: string, selectors?: string | string[]): Promise; /** * Interrupts a running message. * * @example * ```ts * this.screeb.messageClose(); * ``` */ messageClose(): Promise; /** * Starts a message by its ID. * * @example * ```ts * this.screeb.messageStart( * '', * false, * { * color: "green", * article_id: 42 * }, * { * version: "1.0.0", * onMessageShowed: (payload) => console.log("Message showed", payload), * }, * "en" * ); * ``` */ messageStart(messageId: string, allowMultipleResponses?: boolean, hiddenFields?: _Screeb.PropertyRecord, hooks?: _Screeb.HooksMessageStart, language?: string): Promise; /** * Interrupts a running session replay. * * @example * ```ts * this.screeb.sessionReplayStop(); * ``` */ sessionReplayStop(): Promise; /** * Starts a session replay. * * @example * ```ts * this.screeb.sessionReplayStart(); * ``` */ sessionReplayStart(): Promise; /** * Prints the current state of the targeting engine. * * @example * ```ts * console.log(await this.screeb.targetingDebug()); * // targeting ************ SCREEB TARGETING RULES DEBUG ************** * // Disabled surveys are not listed here. * // * // Screeb channel id: * // Screeb respondent id: * // * // Survey : * // https://admin.screeb.app/org/last/survey//share * // * // - Rule of type "Device type (desktop/mobile/tablet)": true 🟢 * // - Rule of type "Multiple display": true 🟢 * // - Rule of type "Capping per time between survey display on current respondent": true 🟢 * // - Rule of type "User event count": false 🔴 * // - Rule of type "Capping per respondent display count": false 🔴 * ``` */ targetingDebug(): Promise; /** * Initializes Screeb tag. * * @param websiteId Your website/channel id. * @param userId The unique identifier of your user. * @param userProperties The properties of your user. * ```text Requirements: * - Property names must be limited to 128 characters * - No more than 1000 attributes * - Supported types for values: string, number, boolean and Date * ``` * @param language Force a specific language for the tag. eg: 'en'. default: browser language. * * @example * ```ts * this.screeb.init( * "", * "", * { * firstname: '', * lastname: '', * plan: '', * last_seen_at: new Date(), * authenticated: true * }, * { * version: "1.0.0", * onReady: (payload) => console.log("Screeb SDK is ready!", payload), * }, * "en" * ); * ``` */ init(websiteId: string, userId?: string, userProperties?: _Screeb.PropertyRecord, hooks?: _Screeb.HooksInit, language?: string, spaNavigationHandler?: _Screeb.SpaNavigationHandler): Promise; /** * Appends Screeb tag into your dom. * * @param options Screeb module options. * @param options.window If you're running Screeb tag in an iframe, please set the inner window here. * @param options.screebEndpoint Please don't do this. * * @example * ```ts * this.screeb.load(); * ``` */ load(options?: _Screeb.ScreebOptions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }