Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@screeb/sdk-browser

Package Overview
Dependencies
Maintainers
0
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@screeb/sdk-browser - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

88

dist/cjs/hooks.types.d.ts

@@ -19,2 +19,6 @@ export type ChannelType = "widget" | "ios" | "android";

};
export type Message = {
id: string;
messagey_size: 100;
};
export type ResponseStatus = "displayed" | "started" | "ended" | "closed" | "interrupted";

@@ -44,4 +48,9 @@ export type ResponseItemQuestion = {

user: User;
};
export type HookCommonPropertiesSurvey = HookCommonProperties & {
survey: Survey;
};
export type HookCommonPropertiesMessage = HookCommonProperties & {
message: Message;
};
export type HookOnReady = (data: {

@@ -51,3 +60,5 @@ channel: Channel;

}) => void;
export type HookOnSurveyShowed = (data: HookCommonProperties & {
export type HookOnSurveyDisplayAllowed = (data: HookCommonPropertiesSurvey) => boolean;
export type HookOnMessageDisplayAllowed = (data: HookCommonPropertiesSurvey) => boolean;
export type HookOnSurveyShowed = (data: HookCommonPropertiesSurvey & {
response: {

@@ -58,3 +69,3 @@ id: string;

}) => void;
export type HookOnSurveyStarted = (data: HookCommonProperties & {
export type HookOnSurveyStarted = (data: HookCommonPropertiesSurvey & {
response: {

@@ -64,23 +75,84 @@ id: string;

}) => void;
export type HookOnQuestionReplied = (data: HookCommonProperties & {
export type HookOnSurveyCompleted = (data: HookCommonPropertiesSurvey & {
response: {
id: string;
status: null;
question: ResponseItemQuestion;
answer: ResponseItemAnswer;
items: ResponseItem[];
};
}) => void;
export type HookOnSurveyCompleted = (data: HookCommonProperties & {
export type HookOnSurveyHidden = (data: HookCommonPropertiesSurvey & {
response: {
id: string;
items: ResponseItem[];
hide_reason: ResponseStatus;
};
}) => void;
export type HookOnSurveyHidden = (data: HookCommonProperties & {
export type HookOnMessageShowed = (data: HookCommonPropertiesMessage & {
response: {
id: string;
items: ResponseItem[];
};
}) => void;
export type HookOnMessageStarted = (data: HookCommonPropertiesMessage & {
response: {
id: string;
};
}) => void;
export type HookOnMessageCompleted = (data: HookCommonPropertiesMessage & {
response: {
id: string;
items: ResponseItem[];
};
}) => void;
export type HookOnMessageHidden = (data: HookCommonPropertiesMessage & {
response: {
id: string;
items: ResponseItem[];
hide_reason: ResponseStatus;
};
}) => void;
export type HookOnQuestionReplied = (data: HookCommonPropertiesSurvey & {
response: {
id: string;
status: null;
question: ResponseItemQuestion;
answer: ResponseItemAnswer;
items: ResponseItem[];
};
}) => void;
/** This is the Screeb tag hooks object available on `survey.start` command. */
export type HooksSurveyStart = {
/** This hook is triggered when a survey is displayed on screen (also triggered when page is reloaded) */
onSurveyShowed?: HookOnSurveyShowed;
/** This hook is triggered when a survey is started */
onSurveyStarted?: HookOnSurveyStarted;
/** This hook is triggered when a survey is completed */
onSurveyCompleted?: HookOnSurveyCompleted;
/** This hook is triggered when a survey is hidden */
onSurveyHidden?: HookOnSurveyHidden;
/** This hook is triggered when a question is answered */
onQuestionReplied?: HookOnQuestionReplied;
};
/** This is the Screeb tag hooks object available on `message.start` command. */
export type HooksMessageStart = {
/** This hook is triggered when a message is displayed on screen (also triggered when page is reloaded) */
onMessageShowed?: HookOnMessageShowed;
/** This hook is triggered when a message is started */
onMessageStarted?: HookOnMessageStarted;
/** This hook is triggered when a message is completed */
onMessageCompleted?: HookOnMessageCompleted;
/** This hook is triggered when a message is hidden */
onMessageHidden?: HookOnMessageHidden;
/** This hook is triggered when a question is answered */
onQuestionReplied?: HookOnQuestionReplied;
};
/** This is the Screeb tag hooks object available on `init` command. */
export type HooksInit = HooksSurveyStart & HooksMessageStart & {
/** This defines the version of hooks and their data */
version: string;
/** This hook is triggered when Screeb SD is loaded, initialized and ready to rock */
onReady?: HookOnReady;
/** This hook is triggered before a survey displays to allow it or not. */
onSurveyDisplayAllowed?: HookOnSurveyDisplayAllowed;
/** This hook is triggered before a message displays to allow it or not. */
onMessageDisplayAllowed?: HookOnMessageDisplayAllowed;
};

9

dist/cjs/index.d.ts

@@ -1,2 +0,3 @@

import { Hooks, PropertyRecord, ScreebIdentityGetReturn, ScreebOptions } from "./types";
import { HooksInit, HooksMessageStart, HooksSurveyStart } from "./hooks.types";
import { PropertyRecord, ScreebIdentityGetReturn, ScreebOptions } from "./types";
export * from "./types";

@@ -57,3 +58,3 @@ export * from "./hooks.types";

*/
export declare const init: (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?: Hooks, language?: string) => void | Promise<unknown>;
export declare const init: (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?: HooksInit, language?: string) => void | Promise<unknown>;
/**

@@ -319,3 +320,3 @@ * Checks if Screeb tag has been loaded.

*/
export declare const surveyStart: (surveyId: string, distributionId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: Hooks, language?: string) => void | Promise<unknown>;
export declare const surveyStart: (surveyId: string, distributionId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => void | Promise<unknown>;
/**

@@ -354,3 +355,3 @@ * Interrupts a running message.

*/
export declare const messageStart: (messageId: string, hiddenFields?: PropertyRecord, hooks?: Hooks, language?: string) => void | Promise<unknown>;
export declare const messageStart: (messageId: string, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => void | Promise<unknown>;
/**

@@ -357,0 +358,0 @@ * Forces a targeting check.

@@ -1,2 +0,1 @@

import { HookOnQuestionReplied, HookOnReady, HookOnSurveyCompleted, HookOnSurveyHidden, HookOnSurveyShowed, HookOnSurveyStarted } from "./hooks.types";
/** This is property types that are supported by Screeb. */

@@ -48,18 +47,1 @@ export type PropertyType = number | boolean | string | Date | PropertyRecord;

};
/** This is the Screeb tag hooks object. */
export type Hooks = {
/** This defines the version of hooks and their data */
version: string;
/** This hook is triggered when Screeb SD is loaded, initialized and ready to rock */
onReady?: HookOnReady;
/** This hook is triggered when a survey is displayed on screen (also triggered when page is reloaded) */
onSurveyShowed?: HookOnSurveyShowed;
/** This hook is triggered when a survey is started */
onSurveyStarted?: HookOnSurveyStarted;
/** This hook is triggered when a question is answered */
onQuestionReplied?: HookOnQuestionReplied;
/** This hook is triggered when a survey is completed */
onSurveyCompleted?: HookOnSurveyCompleted;
/** This hook is triggered when a survey is hidden */
onSurveyHidden?: HookOnSurveyHidden;
};

@@ -19,2 +19,6 @@ export type ChannelType = "widget" | "ios" | "android";

};
export type Message = {
id: string;
messagey_size: 100;
};
export type ResponseStatus = "displayed" | "started" | "ended" | "closed" | "interrupted";

@@ -44,4 +48,9 @@ export type ResponseItemQuestion = {

user: User;
};
export type HookCommonPropertiesSurvey = HookCommonProperties & {
survey: Survey;
};
export type HookCommonPropertiesMessage = HookCommonProperties & {
message: Message;
};
export type HookOnReady = (data: {

@@ -51,3 +60,5 @@ channel: Channel;

}) => void;
export type HookOnSurveyShowed = (data: HookCommonProperties & {
export type HookOnSurveyDisplayAllowed = (data: HookCommonPropertiesSurvey) => boolean;
export type HookOnMessageDisplayAllowed = (data: HookCommonPropertiesSurvey) => boolean;
export type HookOnSurveyShowed = (data: HookCommonPropertiesSurvey & {
response: {

@@ -58,3 +69,3 @@ id: string;

}) => void;
export type HookOnSurveyStarted = (data: HookCommonProperties & {
export type HookOnSurveyStarted = (data: HookCommonPropertiesSurvey & {
response: {

@@ -64,23 +75,84 @@ id: string;

}) => void;
export type HookOnQuestionReplied = (data: HookCommonProperties & {
export type HookOnSurveyCompleted = (data: HookCommonPropertiesSurvey & {
response: {
id: string;
status: null;
question: ResponseItemQuestion;
answer: ResponseItemAnswer;
items: ResponseItem[];
};
}) => void;
export type HookOnSurveyCompleted = (data: HookCommonProperties & {
export type HookOnSurveyHidden = (data: HookCommonPropertiesSurvey & {
response: {
id: string;
items: ResponseItem[];
hide_reason: ResponseStatus;
};
}) => void;
export type HookOnSurveyHidden = (data: HookCommonProperties & {
export type HookOnMessageShowed = (data: HookCommonPropertiesMessage & {
response: {
id: string;
items: ResponseItem[];
};
}) => void;
export type HookOnMessageStarted = (data: HookCommonPropertiesMessage & {
response: {
id: string;
};
}) => void;
export type HookOnMessageCompleted = (data: HookCommonPropertiesMessage & {
response: {
id: string;
items: ResponseItem[];
};
}) => void;
export type HookOnMessageHidden = (data: HookCommonPropertiesMessage & {
response: {
id: string;
items: ResponseItem[];
hide_reason: ResponseStatus;
};
}) => void;
export type HookOnQuestionReplied = (data: HookCommonPropertiesSurvey & {
response: {
id: string;
status: null;
question: ResponseItemQuestion;
answer: ResponseItemAnswer;
items: ResponseItem[];
};
}) => void;
/** This is the Screeb tag hooks object available on `survey.start` command. */
export type HooksSurveyStart = {
/** This hook is triggered when a survey is displayed on screen (also triggered when page is reloaded) */
onSurveyShowed?: HookOnSurveyShowed;
/** This hook is triggered when a survey is started */
onSurveyStarted?: HookOnSurveyStarted;
/** This hook is triggered when a survey is completed */
onSurveyCompleted?: HookOnSurveyCompleted;
/** This hook is triggered when a survey is hidden */
onSurveyHidden?: HookOnSurveyHidden;
/** This hook is triggered when a question is answered */
onQuestionReplied?: HookOnQuestionReplied;
};
/** This is the Screeb tag hooks object available on `message.start` command. */
export type HooksMessageStart = {
/** This hook is triggered when a message is displayed on screen (also triggered when page is reloaded) */
onMessageShowed?: HookOnMessageShowed;
/** This hook is triggered when a message is started */
onMessageStarted?: HookOnMessageStarted;
/** This hook is triggered when a message is completed */
onMessageCompleted?: HookOnMessageCompleted;
/** This hook is triggered when a message is hidden */
onMessageHidden?: HookOnMessageHidden;
/** This hook is triggered when a question is answered */
onQuestionReplied?: HookOnQuestionReplied;
};
/** This is the Screeb tag hooks object available on `init` command. */
export type HooksInit = HooksSurveyStart & HooksMessageStart & {
/** This defines the version of hooks and their data */
version: string;
/** This hook is triggered when Screeb SD is loaded, initialized and ready to rock */
onReady?: HookOnReady;
/** This hook is triggered before a survey displays to allow it or not. */
onSurveyDisplayAllowed?: HookOnSurveyDisplayAllowed;
/** This hook is triggered before a message displays to allow it or not. */
onMessageDisplayAllowed?: HookOnMessageDisplayAllowed;
};

@@ -1,2 +0,3 @@

import { Hooks, PropertyRecord, ScreebIdentityGetReturn, ScreebOptions } from "./types";
import { HooksInit, HooksMessageStart, HooksSurveyStart } from "./hooks.types";
import { PropertyRecord, ScreebIdentityGetReturn, ScreebOptions } from "./types";
export * from "./types";

@@ -57,3 +58,3 @@ export * from "./hooks.types";

*/
export declare const init: (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?: Hooks, language?: string) => void | Promise<unknown>;
export declare const init: (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?: HooksInit, language?: string) => void | Promise<unknown>;
/**

@@ -319,3 +320,3 @@ * Checks if Screeb tag has been loaded.

*/
export declare const surveyStart: (surveyId: string, distributionId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: Hooks, language?: string) => void | Promise<unknown>;
export declare const surveyStart: (surveyId: string, distributionId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => void | Promise<unknown>;
/**

@@ -354,3 +355,3 @@ * Interrupts a running message.

*/
export declare const messageStart: (messageId: string, hiddenFields?: PropertyRecord, hooks?: Hooks, language?: string) => void | Promise<unknown>;
export declare const messageStart: (messageId: string, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => void | Promise<unknown>;
/**

@@ -357,0 +358,0 @@ * Forces a targeting check.

@@ -1,2 +0,1 @@

import { HookOnQuestionReplied, HookOnReady, HookOnSurveyCompleted, HookOnSurveyHidden, HookOnSurveyShowed, HookOnSurveyStarted } from "./hooks.types";
/** This is property types that are supported by Screeb. */

@@ -48,18 +47,1 @@ export type PropertyType = number | boolean | string | Date | PropertyRecord;

};
/** This is the Screeb tag hooks object. */
export type Hooks = {
/** This defines the version of hooks and their data */
version: string;
/** This hook is triggered when Screeb SD is loaded, initialized and ready to rock */
onReady?: HookOnReady;
/** This hook is triggered when a survey is displayed on screen (also triggered when page is reloaded) */
onSurveyShowed?: HookOnSurveyShowed;
/** This hook is triggered when a survey is started */
onSurveyStarted?: HookOnSurveyStarted;
/** This hook is triggered when a question is answered */
onQuestionReplied?: HookOnQuestionReplied;
/** This hook is triggered when a survey is completed */
onSurveyCompleted?: HookOnSurveyCompleted;
/** This hook is triggered when a survey is hidden */
onSurveyHidden?: HookOnSurveyHidden;
};

@@ -12,9 +12,20 @@ @screeb/sdk-browser

- [HookCommonProperties](README.md#hookcommonproperties)
- [HookCommonPropertiesMessage](README.md#hookcommonpropertiesmessage)
- [HookCommonPropertiesSurvey](README.md#hookcommonpropertiessurvey)
- [HookOnMessageCompleted](README.md#hookonmessagecompleted)
- [HookOnMessageDisplayAllowed](README.md#hookonmessagedisplayallowed)
- [HookOnMessageHidden](README.md#hookonmessagehidden)
- [HookOnMessageShowed](README.md#hookonmessageshowed)
- [HookOnMessageStarted](README.md#hookonmessagestarted)
- [HookOnQuestionReplied](README.md#hookonquestionreplied)
- [HookOnReady](README.md#hookonready)
- [HookOnSurveyCompleted](README.md#hookonsurveycompleted)
- [HookOnSurveyDisplayAllowed](README.md#hookonsurveydisplayallowed)
- [HookOnSurveyHidden](README.md#hookonsurveyhidden)
- [HookOnSurveyShowed](README.md#hookonsurveyshowed)
- [HookOnSurveyStarted](README.md#hookonsurveystarted)
- [Hooks](README.md#hooks)
- [HooksInit](README.md#hooksinit)
- [HooksMessageStart](README.md#hooksmessagestart)
- [HooksSurveyStart](README.md#hookssurveystart)
- [Message](README.md#message)
- [PropertyRecord](README.md#propertyrecord)

@@ -87,3 +98,2 @@ - [PropertyType](README.md#propertytype)

| `channel` | [`Channel`](README.md#channel) |
| `survey` | [`Survey`](README.md#survey) |
| `user` | [`User`](README.md#user) |

@@ -93,5 +103,117 @@

### HookCommonPropertiesMessage
Ƭ **HookCommonPropertiesMessage**: [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `message`: [`Message`](README.md#message) }
___
### HookCommonPropertiesSurvey
Ƭ **HookCommonPropertiesSurvey**: [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `survey`: [`Survey`](README.md#survey) }
___
### HookOnMessageCompleted
Ƭ **HookOnMessageCompleted**: (`data`: [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`
#### Type declaration
▸ (`data`): `void`
##### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |
##### Returns
`void`
___
### HookOnMessageDisplayAllowed
Ƭ **HookOnMessageDisplayAllowed**: (`data`: [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey)) => `boolean`
#### Type declaration
▸ (`data`): `boolean`
##### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) |
##### Returns
`boolean`
___
### HookOnMessageHidden
Ƭ **HookOnMessageHidden**: (`data`: [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `hide_reason`: [`ResponseStatus`](README.md#responsestatus) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`
#### Type declaration
▸ (`data`): `void`
##### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `hide_reason`: [`ResponseStatus`](README.md#responsestatus) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |
##### Returns
`void`
___
### HookOnMessageShowed
Ƭ **HookOnMessageShowed**: (`data`: [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`
#### Type declaration
▸ (`data`): `void`
##### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |
##### Returns
`void`
___
### HookOnMessageStarted
Ƭ **HookOnMessageStarted**: (`data`: [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `id`: `string` } }) => `void`
#### Type declaration
▸ (`data`): `void`
##### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`HookCommonPropertiesMessage`](README.md#hookcommonpropertiesmessage) & \{ `response`: \{ `id`: `string` } } |
##### Returns
`void`
___
### HookOnQuestionReplied
Ƭ **HookOnQuestionReplied**: (`data`: [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `answer`: [`ResponseItemAnswer`](README.md#responseitemanswer) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] ; `question`: [`ResponseItemQuestion`](README.md#responseitemquestion) ; `status`: ``null`` } }) => `void`
Ƭ **HookOnQuestionReplied**: (`data`: [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `answer`: [`ResponseItemAnswer`](README.md#responseitemanswer) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] ; `question`: [`ResponseItemQuestion`](README.md#responseitemquestion) ; `status`: ``null`` } }) => `void`

@@ -106,3 +228,3 @@ #### Type declaration

| :------ | :------ |
| `data` | [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `answer`: [`ResponseItemAnswer`](README.md#responseitemanswer) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] ; `question`: [`ResponseItemQuestion`](README.md#responseitemquestion) ; `status`: ``null`` } } |
| `data` | [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `answer`: [`ResponseItemAnswer`](README.md#responseitemanswer) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] ; `question`: [`ResponseItemQuestion`](README.md#responseitemquestion) ; `status`: ``null`` } } |

@@ -139,3 +261,3 @@ ##### Returns

Ƭ **HookOnSurveyCompleted**: (`data`: [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`
Ƭ **HookOnSurveyCompleted**: (`data`: [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`

@@ -150,3 +272,3 @@ #### Type declaration

| :------ | :------ |
| `data` | [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |
| `data` | [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |

@@ -159,5 +281,25 @@ ##### Returns

### HookOnSurveyDisplayAllowed
Ƭ **HookOnSurveyDisplayAllowed**: (`data`: [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey)) => `boolean`
#### Type declaration
▸ (`data`): `boolean`
##### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) |
##### Returns
`boolean`
___
### HookOnSurveyHidden
Ƭ **HookOnSurveyHidden**: (`data`: [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `hide_reason`: [`ResponseStatus`](README.md#responsestatus) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`
Ƭ **HookOnSurveyHidden**: (`data`: [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `hide_reason`: [`ResponseStatus`](README.md#responsestatus) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`

@@ -172,3 +314,3 @@ #### Type declaration

| :------ | :------ |
| `data` | [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `hide_reason`: [`ResponseStatus`](README.md#responsestatus) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |
| `data` | [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `hide_reason`: [`ResponseStatus`](README.md#responsestatus) ; `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |

@@ -183,3 +325,3 @@ ##### Returns

Ƭ **HookOnSurveyShowed**: (`data`: [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`
Ƭ **HookOnSurveyShowed**: (`data`: [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } }) => `void`

@@ -194,3 +336,3 @@ #### Type declaration

| :------ | :------ |
| `data` | [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |
| `data` | [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `id`: `string` ; `items`: [`ResponseItem`](README.md#responseitem)[] } } |

@@ -205,3 +347,3 @@ ##### Returns

Ƭ **HookOnSurveyStarted**: (`data`: [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `id`: `string` } }) => `void`
Ƭ **HookOnSurveyStarted**: (`data`: [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `id`: `string` } }) => `void`

@@ -216,3 +358,3 @@ #### Type declaration

| :------ | :------ |
| `data` | [`HookCommonProperties`](README.md#hookcommonproperties) & \{ `response`: \{ `id`: `string` } } |
| `data` | [`HookCommonPropertiesSurvey`](README.md#hookcommonpropertiessurvey) & \{ `response`: \{ `id`: `string` } } |

@@ -225,8 +367,16 @@ ##### Returns

### Hooks
### HooksInit
Ƭ **Hooks**: `Object`
Ƭ **HooksInit**: [`HooksSurveyStart`](README.md#hookssurveystart) & [`HooksMessageStart`](README.md#hooksmessagestart) & \{ `onMessageDisplayAllowed?`: [`HookOnMessageDisplayAllowed`](README.md#hookonmessagedisplayallowed) ; `onReady?`: [`HookOnReady`](README.md#hookonready) ; `onSurveyDisplayAllowed?`: [`HookOnSurveyDisplayAllowed`](README.md#hookonsurveydisplayallowed) ; `version`: `string` }
This is the Screeb tag hooks object.
This is the Screeb tag hooks object available on `init` command.
___
### HooksMessageStart
Ƭ **HooksMessageStart**: `Object`
This is the Screeb tag hooks object available on `message.start` command.
#### Type declaration

@@ -236,4 +386,21 @@

| :------ | :------ | :------ |
| `onMessageCompleted?` | [`HookOnMessageCompleted`](README.md#hookonmessagecompleted) | This hook is triggered when a message is completed |
| `onMessageHidden?` | [`HookOnMessageHidden`](README.md#hookonmessagehidden) | This hook is triggered when a message is hidden |
| `onMessageShowed?` | [`HookOnMessageShowed`](README.md#hookonmessageshowed) | This hook is triggered when a message is displayed on screen (also triggered when page is reloaded) |
| `onMessageStarted?` | [`HookOnMessageStarted`](README.md#hookonmessagestarted) | This hook is triggered when a message is started |
| `onQuestionReplied?` | [`HookOnQuestionReplied`](README.md#hookonquestionreplied) | This hook is triggered when a question is answered |
| `onReady?` | [`HookOnReady`](README.md#hookonready) | This hook is triggered when Screeb SD is loaded, initialized and ready to rock |
___
### HooksSurveyStart
Ƭ **HooksSurveyStart**: `Object`
This is the Screeb tag hooks object available on `survey.start` command.
#### Type declaration
| Name | Type | Description |
| :------ | :------ | :------ |
| `onQuestionReplied?` | [`HookOnQuestionReplied`](README.md#hookonquestionreplied) | This hook is triggered when a question is answered |
| `onSurveyCompleted?` | [`HookOnSurveyCompleted`](README.md#hookonsurveycompleted) | This hook is triggered when a survey is completed |

@@ -243,6 +410,18 @@ | `onSurveyHidden?` | [`HookOnSurveyHidden`](README.md#hookonsurveyhidden) | This hook is triggered when a survey is hidden |

| `onSurveyStarted?` | [`HookOnSurveyStarted`](README.md#hookonsurveystarted) | This hook is triggered when a survey is started |
| `version` | `string` | This defines the version of hooks and their data |
___
### Message
Ƭ **Message**: `Object`
#### Type declaration
| Name | Type |
| :------ | :------ |
| `id` | `string` |
| `messagey_size` | ``100`` |
___
### PropertyRecord

@@ -733,3 +912,3 @@

| `userProperties?` | [`PropertyRecord`](README.md#propertyrecord) | 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 ``` |
| `hooks?` | [`Hooks`](README.md#hooks) | Hooks to be called when SDK is ready or a survey is showed, started, completed, hidden or when a question is replied. |
| `hooks?` | [`HooksInit`](README.md#hooksinit) | Hooks to be called when SDK is ready or a survey is showed, started, completed, hidden or when a question is replied. |
| `language?` | `string` | Force a specific language for the tag. eg: 'en'. default: browser language. |

@@ -846,3 +1025,3 @@

| `hiddenFields` | [`PropertyRecord`](README.md#propertyrecord) |
| `hooks?` | [`Hooks`](README.md#hooks) |
| `hooks?` | [`HooksMessageStart`](README.md#hooksmessagestart) |
| `language?` | `string` |

@@ -910,3 +1089,3 @@

| `hiddenFields` | [`PropertyRecord`](README.md#propertyrecord) | `{}` |
| `hooks?` | [`Hooks`](README.md#hooks) | `undefined` |
| `hooks?` | [`HooksSurveyStart`](README.md#hookssurveystart) | `undefined` |
| `language?` | `string` | `undefined` |

@@ -913,0 +1092,0 @@

{
"name": "@screeb/sdk-browser",
"version": "0.2.0",
"version": "0.2.1",
"description": "Screeb's browser sdk.",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc