@screeb/sdk-react 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/types.d.ts +5 -5
- package/dist/es/index.mjs +1 -1
- package/dist/es/types.d.ts +5 -5
- package/docs/README.md +11 -11
- package/package.json +2 -3
package/dist/cjs/index.cjs
CHANGED
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HooksInit, HooksMessageStart, HooksSurveyStart, PropertyRecord, ScreebIdentityGetReturn, ScreebOptions } from "@screeb/sdk-browser";
|
|
2
2
|
/** Properties of Screeb provider */
|
|
3
3
|
export type ScreebProps = {
|
|
4
4
|
/** Your website/channel id. */
|
|
@@ -8,7 +8,7 @@ export type ScreebProps = {
|
|
|
8
8
|
/** The properties of your user. */
|
|
9
9
|
userProperties?: PropertyRecord;
|
|
10
10
|
/** Hooks to define callback for various event */
|
|
11
|
-
hooks?:
|
|
11
|
+
hooks?: HooksInit;
|
|
12
12
|
/** The language you want to force */
|
|
13
13
|
language?: string;
|
|
14
14
|
};
|
|
@@ -256,7 +256,7 @@ export type IdentityResetFunction = () => Promise<unknown>;
|
|
|
256
256
|
* );
|
|
257
257
|
* ```
|
|
258
258
|
*/
|
|
259
|
-
export type InitFunction = (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?:
|
|
259
|
+
export type InitFunction = (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?: HooksInit, language?: string) => Promise<void>;
|
|
260
260
|
/**
|
|
261
261
|
* Appends Screeb tag into your dom.
|
|
262
262
|
*
|
|
@@ -301,7 +301,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
|
|
|
301
301
|
* );
|
|
302
302
|
* ```
|
|
303
303
|
*/
|
|
304
|
-
export type SurveyStartFunction = (surveyId: string, distributionId
|
|
304
|
+
export type SurveyStartFunction = (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => Promise<unknown>;
|
|
305
305
|
/**
|
|
306
306
|
* Interrupts a running message.
|
|
307
307
|
*
|
|
@@ -330,7 +330,7 @@ export type MessageCloseFunction = () => Promise<unknown>;
|
|
|
330
330
|
* );
|
|
331
331
|
* ```
|
|
332
332
|
*/
|
|
333
|
-
export type MessageStartFunction = (messageId: string, hiddenFields: PropertyRecord, hooks?:
|
|
333
|
+
export type MessageStartFunction = (messageId: string, hiddenFields: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
|
|
334
334
|
/**
|
|
335
335
|
* Forces a targeting check.
|
|
336
336
|
*
|
package/dist/es/index.mjs
CHANGED
package/dist/es/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HooksInit, HooksMessageStart, HooksSurveyStart, PropertyRecord, ScreebIdentityGetReturn, ScreebOptions } from "@screeb/sdk-browser";
|
|
2
2
|
/** Properties of Screeb provider */
|
|
3
3
|
export type ScreebProps = {
|
|
4
4
|
/** Your website/channel id. */
|
|
@@ -8,7 +8,7 @@ export type ScreebProps = {
|
|
|
8
8
|
/** The properties of your user. */
|
|
9
9
|
userProperties?: PropertyRecord;
|
|
10
10
|
/** Hooks to define callback for various event */
|
|
11
|
-
hooks?:
|
|
11
|
+
hooks?: HooksInit;
|
|
12
12
|
/** The language you want to force */
|
|
13
13
|
language?: string;
|
|
14
14
|
};
|
|
@@ -256,7 +256,7 @@ export type IdentityResetFunction = () => Promise<unknown>;
|
|
|
256
256
|
* );
|
|
257
257
|
* ```
|
|
258
258
|
*/
|
|
259
|
-
export type InitFunction = (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?:
|
|
259
|
+
export type InitFunction = (websiteId: string, userId?: string, userProperties?: PropertyRecord, hooks?: HooksInit, language?: string) => Promise<void>;
|
|
260
260
|
/**
|
|
261
261
|
* Appends Screeb tag into your dom.
|
|
262
262
|
*
|
|
@@ -301,7 +301,7 @@ export type SurveyCloseFunction = () => Promise<unknown>;
|
|
|
301
301
|
* );
|
|
302
302
|
* ```
|
|
303
303
|
*/
|
|
304
|
-
export type SurveyStartFunction = (surveyId: string, distributionId
|
|
304
|
+
export type SurveyStartFunction = (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => Promise<unknown>;
|
|
305
305
|
/**
|
|
306
306
|
* Interrupts a running message.
|
|
307
307
|
*
|
|
@@ -330,7 +330,7 @@ export type MessageCloseFunction = () => Promise<unknown>;
|
|
|
330
330
|
* );
|
|
331
331
|
* ```
|
|
332
332
|
*/
|
|
333
|
-
export type MessageStartFunction = (messageId: string, hiddenFields: PropertyRecord, hooks?:
|
|
333
|
+
export type MessageStartFunction = (messageId: string, hiddenFields: PropertyRecord, hooks?: HooksMessageStart, language?: string) => Promise<unknown>;
|
|
334
334
|
/**
|
|
335
335
|
* Forces a targeting check.
|
|
336
336
|
*
|
package/docs/README.md
CHANGED
|
@@ -366,7 +366,7 @@ ___
|
|
|
366
366
|
|
|
367
367
|
### InitFunction
|
|
368
368
|
|
|
369
|
-
Ƭ **InitFunction**: (`websiteId`: `string`, `userId?`: `string`, `userProperties?`: `PropertyRecord`, `hooks?`: `
|
|
369
|
+
Ƭ **InitFunction**: (`websiteId`: `string`, `userId?`: `string`, `userProperties?`: `PropertyRecord`, `hooks?`: `HooksInit`, `language?`: `string`) => `Promise`\<`void`\>
|
|
370
370
|
|
|
371
371
|
Initializes Screeb tag.
|
|
372
372
|
|
|
@@ -400,7 +400,7 @@ init(
|
|
|
400
400
|
| `websiteId` | `string` | Your website/channel id. |
|
|
401
401
|
| `userId?` | `string` | The unique identifier of your user. |
|
|
402
402
|
| `userProperties?` | `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 ``` |
|
|
403
|
-
| `hooks?` | `
|
|
403
|
+
| `hooks?` | `HooksInit` | - |
|
|
404
404
|
| `language?` | `string` | Force a specific language for the tag. eg: 'en'. default: browser language. |
|
|
405
405
|
|
|
406
406
|
##### Returns
|
|
@@ -465,7 +465,7 @@ ___
|
|
|
465
465
|
|
|
466
466
|
### MessageStartFunction
|
|
467
467
|
|
|
468
|
-
Ƭ **MessageStartFunction**: (`messageId`: `string`, `hiddenFields`: `PropertyRecord`, `hooks?`: `
|
|
468
|
+
Ƭ **MessageStartFunction**: (`messageId`: `string`, `hiddenFields`: `PropertyRecord`, `hooks?`: `HooksMessageStart`, `language?`: `string`) => `Promise`\<`unknown`\>
|
|
469
469
|
|
|
470
470
|
Starts a message by its ID.
|
|
471
471
|
|
|
@@ -494,7 +494,7 @@ messageStart(
|
|
|
494
494
|
| :------ | :------ |
|
|
495
495
|
| `messageId` | `string` |
|
|
496
496
|
| `hiddenFields` | `PropertyRecord` |
|
|
497
|
-
| `hooks?` | `
|
|
497
|
+
| `hooks?` | `HooksMessageStart` |
|
|
498
498
|
| `language?` | `string` |
|
|
499
499
|
|
|
500
500
|
##### Returns
|
|
@@ -543,7 +543,7 @@ Properties of Screeb provider
|
|
|
543
543
|
|
|
544
544
|
| Name | Type | Description |
|
|
545
545
|
| :------ | :------ | :------ |
|
|
546
|
-
| `hooks?` | `
|
|
546
|
+
| `hooks?` | `HooksInit` | Hooks to define callback for various event |
|
|
547
547
|
| `language?` | `string` | The language you want to force |
|
|
548
548
|
| `userId?` | `string` | The unique identifier of your user. |
|
|
549
549
|
| `userProperties?` | `PropertyRecord` | The properties of your user. |
|
|
@@ -585,7 +585,7 @@ ___
|
|
|
585
585
|
|
|
586
586
|
### SurveyStartFunction
|
|
587
587
|
|
|
588
|
-
Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId
|
|
588
|
+
Ƭ **SurveyStartFunction**: (`surveyId`: `string`, `distributionId?`: `string`, `allowMultipleResponses?`: `boolean`, `hiddenFields?`: `PropertyRecord`, `hooks?`: `HooksSurveyStart`, `language?`: `string`) => `Promise`\<`unknown`\>
|
|
589
589
|
|
|
590
590
|
Starts a survey by its ID.
|
|
591
591
|
|
|
@@ -607,17 +607,17 @@ surveyStart(
|
|
|
607
607
|
|
|
608
608
|
#### Type declaration
|
|
609
609
|
|
|
610
|
-
▸ (`surveyId`, `distributionId
|
|
610
|
+
▸ (`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `Promise`\<`unknown`\>
|
|
611
611
|
|
|
612
612
|
##### Parameters
|
|
613
613
|
|
|
614
614
|
| Name | Type |
|
|
615
615
|
| :------ | :------ |
|
|
616
616
|
| `surveyId` | `string` |
|
|
617
|
-
| `distributionId
|
|
618
|
-
| `allowMultipleResponses
|
|
619
|
-
| `hiddenFields
|
|
620
|
-
| `hooks?` | `
|
|
617
|
+
| `distributionId?` | `string` |
|
|
618
|
+
| `allowMultipleResponses?` | `boolean` |
|
|
619
|
+
| `hiddenFields?` | `PropertyRecord` |
|
|
620
|
+
| `hooks?` | `HooksSurveyStart` |
|
|
621
621
|
| `language?` | `string` |
|
|
622
622
|
|
|
623
623
|
##### Returns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@screeb/sdk-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Screeb's browser sdk, optimized for React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"product discovery",
|
|
@@ -41,11 +41,10 @@
|
|
|
41
41
|
"test": "echo '@TODO'"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@screeb/sdk-browser": "^0.2.
|
|
44
|
+
"@screeb/sdk-browser": "^0.2.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@screeb/eslint-config": "^0.1.6",
|
|
48
|
-
"@screeb/sdk-browser": "^0.1.6",
|
|
49
48
|
"@screeb/typescript-config": "^0.1.10",
|
|
50
49
|
"@types/jest": "^29.5.5",
|
|
51
50
|
"@types/node": "^20.8.4",
|