@screeb/sdk-browser 0.3.0 → 0.5.0
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 +35 -7
- package/dist/cjs/index.d.ts +27 -4
- package/dist/es/index.d.ts +27 -4
- package/dist/es/index.mjs +34 -8
- package/docs/README.md +48 -4
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -414,27 +414,29 @@ var surveyClose = function () { return callScreebCommand("survey.close"); };
|
|
|
414
414
|
* '<UUID>',
|
|
415
415
|
* '<UUID>',
|
|
416
416
|
* false,
|
|
417
|
-
* {
|
|
417
|
+
* { // optional
|
|
418
418
|
* color: "green",
|
|
419
419
|
* article_id: 42
|
|
420
420
|
* },
|
|
421
|
-
* {
|
|
421
|
+
* { // optional
|
|
422
422
|
* version: "1.0.0",
|
|
423
423
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
424
424
|
* },
|
|
425
|
-
* "en"
|
|
425
|
+
* "en", // optional
|
|
426
|
+
* "#screeb-survey-container" // optional
|
|
426
427
|
* );
|
|
427
428
|
* ```
|
|
428
429
|
*/
|
|
429
|
-
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) {
|
|
430
|
+
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors) {
|
|
430
431
|
if (allowMultipleResponses === void 0) { allowMultipleResponses = true; }
|
|
431
432
|
if (hiddenFields === void 0) { hiddenFields = {}; }
|
|
432
433
|
return callScreebCommand("survey.start", surveyId, {
|
|
433
|
-
distribution_id: distributionId,
|
|
434
434
|
allow_multiple_responses: allowMultipleResponses,
|
|
435
|
-
|
|
435
|
+
distribution_id: distributionId,
|
|
436
436
|
hidden_fields: hiddenFields,
|
|
437
437
|
hooks: hooks,
|
|
438
|
+
language: language,
|
|
439
|
+
selectors: selectors,
|
|
438
440
|
});
|
|
439
441
|
};
|
|
440
442
|
/**
|
|
@@ -480,6 +482,30 @@ var messageStart = function (messageId, allowMultipleResponses, hiddenFields, ho
|
|
|
480
482
|
hooks: hooks,
|
|
481
483
|
});
|
|
482
484
|
};
|
|
485
|
+
/**
|
|
486
|
+
* Interrupts a running session replay.
|
|
487
|
+
*
|
|
488
|
+
* @example
|
|
489
|
+
* ```ts
|
|
490
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
491
|
+
*
|
|
492
|
+
* Screeb.sessionReplayStop();
|
|
493
|
+
* ```
|
|
494
|
+
*/
|
|
495
|
+
var sessionReplayStop = function () { return callScreebCommand("session-replay.stop"); };
|
|
496
|
+
/**
|
|
497
|
+
* Starts a session replay.
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```ts
|
|
501
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
502
|
+
*
|
|
503
|
+
* Screeb.sessionReplayStart();
|
|
504
|
+
* ```
|
|
505
|
+
*/
|
|
506
|
+
var sessionReplayStart = function () {
|
|
507
|
+
return callScreebCommand("session-replay.start");
|
|
508
|
+
};
|
|
483
509
|
/**
|
|
484
510
|
* Forces a targeting check.
|
|
485
511
|
*
|
|
@@ -531,8 +557,10 @@ exports.isLoaded = isLoaded;
|
|
|
531
557
|
exports.load = load;
|
|
532
558
|
exports.messageClose = messageClose;
|
|
533
559
|
exports.messageStart = messageStart;
|
|
560
|
+
exports.sessionReplayStart = sessionReplayStart;
|
|
561
|
+
exports.sessionReplayStop = sessionReplayStop;
|
|
534
562
|
exports.surveyClose = surveyClose;
|
|
535
563
|
exports.surveyStart = surveyStart;
|
|
536
564
|
exports.targetingCheck = targetingCheck;
|
|
537
565
|
exports.targetingDebug = targetingDebug;
|
|
538
|
-
CONSTANTS.version = '0.
|
|
566
|
+
CONSTANTS.version = '0.5.0'
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -304,19 +304,20 @@ export declare const surveyClose: () => void | Promise<unknown>;
|
|
|
304
304
|
* '<UUID>',
|
|
305
305
|
* '<UUID>',
|
|
306
306
|
* false,
|
|
307
|
-
* {
|
|
307
|
+
* { // optional
|
|
308
308
|
* color: "green",
|
|
309
309
|
* article_id: 42
|
|
310
310
|
* },
|
|
311
|
-
* {
|
|
311
|
+
* { // optional
|
|
312
312
|
* version: "1.0.0",
|
|
313
313
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
314
314
|
* },
|
|
315
|
-
* "en"
|
|
315
|
+
* "en", // optional
|
|
316
|
+
* "#screeb-survey-container" // optional
|
|
316
317
|
* );
|
|
317
318
|
* ```
|
|
318
319
|
*/
|
|
319
|
-
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => void | Promise<unknown>;
|
|
320
|
+
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string, selectors?: string | string[]) => void | Promise<unknown>;
|
|
320
321
|
/**
|
|
321
322
|
* Interrupts a running message.
|
|
322
323
|
*
|
|
@@ -351,6 +352,28 @@ export declare const messageClose: () => void | Promise<unknown>;
|
|
|
351
352
|
* ```
|
|
352
353
|
*/
|
|
353
354
|
export declare const messageStart: (messageId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => void | Promise<unknown>;
|
|
355
|
+
/**
|
|
356
|
+
* Interrupts a running session replay.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
361
|
+
*
|
|
362
|
+
* Screeb.sessionReplayStop();
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
export declare const sessionReplayStop: () => void | Promise<unknown>;
|
|
366
|
+
/**
|
|
367
|
+
* Starts a session replay.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
372
|
+
*
|
|
373
|
+
* Screeb.sessionReplayStart();
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
export declare const sessionReplayStart: () => void | Promise<unknown>;
|
|
354
377
|
/**
|
|
355
378
|
* Forces a targeting check.
|
|
356
379
|
*
|
package/dist/es/index.d.ts
CHANGED
|
@@ -304,19 +304,20 @@ export declare const surveyClose: () => void | Promise<unknown>;
|
|
|
304
304
|
* '<UUID>',
|
|
305
305
|
* '<UUID>',
|
|
306
306
|
* false,
|
|
307
|
-
* {
|
|
307
|
+
* { // optional
|
|
308
308
|
* color: "green",
|
|
309
309
|
* article_id: 42
|
|
310
310
|
* },
|
|
311
|
-
* {
|
|
311
|
+
* { // optional
|
|
312
312
|
* version: "1.0.0",
|
|
313
313
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
314
314
|
* },
|
|
315
|
-
* "en"
|
|
315
|
+
* "en", // optional
|
|
316
|
+
* "#screeb-survey-container" // optional
|
|
316
317
|
* );
|
|
317
318
|
* ```
|
|
318
319
|
*/
|
|
319
|
-
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => void | Promise<unknown>;
|
|
320
|
+
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string, selectors?: string | string[]) => void | Promise<unknown>;
|
|
320
321
|
/**
|
|
321
322
|
* Interrupts a running message.
|
|
322
323
|
*
|
|
@@ -351,6 +352,28 @@ export declare const messageClose: () => void | Promise<unknown>;
|
|
|
351
352
|
* ```
|
|
352
353
|
*/
|
|
353
354
|
export declare const messageStart: (messageId: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksMessageStart, language?: string) => void | Promise<unknown>;
|
|
355
|
+
/**
|
|
356
|
+
* Interrupts a running session replay.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
361
|
+
*
|
|
362
|
+
* Screeb.sessionReplayStop();
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
export declare const sessionReplayStop: () => void | Promise<unknown>;
|
|
366
|
+
/**
|
|
367
|
+
* Starts a session replay.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
372
|
+
*
|
|
373
|
+
* Screeb.sessionReplayStart();
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
376
|
+
export declare const sessionReplayStart: () => void | Promise<unknown>;
|
|
354
377
|
/**
|
|
355
378
|
* Forces a targeting check.
|
|
356
379
|
*
|
package/dist/es/index.mjs
CHANGED
|
@@ -412,27 +412,29 @@ var surveyClose = function () { return callScreebCommand("survey.close"); };
|
|
|
412
412
|
* '<UUID>',
|
|
413
413
|
* '<UUID>',
|
|
414
414
|
* false,
|
|
415
|
-
* {
|
|
415
|
+
* { // optional
|
|
416
416
|
* color: "green",
|
|
417
417
|
* article_id: 42
|
|
418
418
|
* },
|
|
419
|
-
* {
|
|
419
|
+
* { // optional
|
|
420
420
|
* version: "1.0.0",
|
|
421
421
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
422
422
|
* },
|
|
423
|
-
* "en"
|
|
423
|
+
* "en", // optional
|
|
424
|
+
* "#screeb-survey-container" // optional
|
|
424
425
|
* );
|
|
425
426
|
* ```
|
|
426
427
|
*/
|
|
427
|
-
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) {
|
|
428
|
+
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors) {
|
|
428
429
|
if (allowMultipleResponses === void 0) { allowMultipleResponses = true; }
|
|
429
430
|
if (hiddenFields === void 0) { hiddenFields = {}; }
|
|
430
431
|
return callScreebCommand("survey.start", surveyId, {
|
|
431
|
-
distribution_id: distributionId,
|
|
432
432
|
allow_multiple_responses: allowMultipleResponses,
|
|
433
|
-
|
|
433
|
+
distribution_id: distributionId,
|
|
434
434
|
hidden_fields: hiddenFields,
|
|
435
435
|
hooks: hooks,
|
|
436
|
+
language: language,
|
|
437
|
+
selectors: selectors,
|
|
436
438
|
});
|
|
437
439
|
};
|
|
438
440
|
/**
|
|
@@ -478,6 +480,30 @@ var messageStart = function (messageId, allowMultipleResponses, hiddenFields, ho
|
|
|
478
480
|
hooks: hooks,
|
|
479
481
|
});
|
|
480
482
|
};
|
|
483
|
+
/**
|
|
484
|
+
* Interrupts a running session replay.
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* ```ts
|
|
488
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
489
|
+
*
|
|
490
|
+
* Screeb.sessionReplayStop();
|
|
491
|
+
* ```
|
|
492
|
+
*/
|
|
493
|
+
var sessionReplayStop = function () { return callScreebCommand("session-replay.stop"); };
|
|
494
|
+
/**
|
|
495
|
+
* Starts a session replay.
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```ts
|
|
499
|
+
* import * as Screeb from "@screeb/sdk-browser";
|
|
500
|
+
*
|
|
501
|
+
* Screeb.sessionReplayStart();
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
504
|
+
var sessionReplayStart = function () {
|
|
505
|
+
return callScreebCommand("session-replay.start");
|
|
506
|
+
};
|
|
481
507
|
/**
|
|
482
508
|
* Forces a targeting check.
|
|
483
509
|
*
|
|
@@ -515,5 +541,5 @@ var targetingCheck = function () { return callScreebCommand("targeting.check");
|
|
|
515
541
|
*/
|
|
516
542
|
var targetingDebug = function () { return callScreebCommand("targeting.debug"); };
|
|
517
543
|
|
|
518
|
-
export { close, debug, eventTrack, identity, identityGet, identityGroupAssign, identityGroupUnassign, identityProperties, identityReset, init, isLoaded, load, messageClose, messageStart, surveyClose, surveyStart, targetingCheck, targetingDebug };
|
|
519
|
-
CONSTANTS.version = '0.
|
|
544
|
+
export { close, debug, eventTrack, identity, identityGet, identityGroupAssign, identityGroupUnassign, identityProperties, identityReset, init, isLoaded, load, messageClose, messageStart, sessionReplayStart, sessionReplayStop, surveyClose, surveyStart, targetingCheck, targetingDebug };
|
|
545
|
+
CONSTANTS.version = '0.5.0'
|
package/docs/README.md
CHANGED
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
- [load](README.md#load)
|
|
60
60
|
- [messageClose](README.md#messageclose)
|
|
61
61
|
- [messageStart](README.md#messagestart)
|
|
62
|
+
- [sessionReplayStart](README.md#sessionreplaystart)
|
|
63
|
+
- [sessionReplayStop](README.md#sessionreplaystop)
|
|
62
64
|
- [surveyClose](README.md#surveyclose)
|
|
63
65
|
- [surveyStart](README.md#surveystart)
|
|
64
66
|
- [targetingCheck](README.md#targetingcheck)
|
|
@@ -1036,6 +1038,46 @@ Screeb.messageStart(
|
|
|
1036
1038
|
|
|
1037
1039
|
___
|
|
1038
1040
|
|
|
1041
|
+
### sessionReplayStart
|
|
1042
|
+
|
|
1043
|
+
▸ **sessionReplayStart**(): `void` \| `Promise`\<`unknown`\>
|
|
1044
|
+
|
|
1045
|
+
Starts a session replay.
|
|
1046
|
+
|
|
1047
|
+
#### Returns
|
|
1048
|
+
|
|
1049
|
+
`void` \| `Promise`\<`unknown`\>
|
|
1050
|
+
|
|
1051
|
+
**`Example`**
|
|
1052
|
+
|
|
1053
|
+
```ts
|
|
1054
|
+
import * as Screeb from "@screeb/sdk-browser";
|
|
1055
|
+
|
|
1056
|
+
Screeb.sessionReplayStart();
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
___
|
|
1060
|
+
|
|
1061
|
+
### sessionReplayStop
|
|
1062
|
+
|
|
1063
|
+
▸ **sessionReplayStop**(): `void` \| `Promise`\<`unknown`\>
|
|
1064
|
+
|
|
1065
|
+
Interrupts a running session replay.
|
|
1066
|
+
|
|
1067
|
+
#### Returns
|
|
1068
|
+
|
|
1069
|
+
`void` \| `Promise`\<`unknown`\>
|
|
1070
|
+
|
|
1071
|
+
**`Example`**
|
|
1072
|
+
|
|
1073
|
+
```ts
|
|
1074
|
+
import * as Screeb from "@screeb/sdk-browser";
|
|
1075
|
+
|
|
1076
|
+
Screeb.sessionReplayStop();
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
___
|
|
1080
|
+
|
|
1039
1081
|
### surveyClose
|
|
1040
1082
|
|
|
1041
1083
|
▸ **surveyClose**(): `void` \| `Promise`\<`unknown`\>
|
|
@@ -1058,7 +1100,7 @@ ___
|
|
|
1058
1100
|
|
|
1059
1101
|
### surveyStart
|
|
1060
1102
|
|
|
1061
|
-
▸ **surveyStart**(`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `void` \| `Promise`\<`unknown`\>
|
|
1103
|
+
▸ **surveyStart**(`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`, `selectors?`): `void` \| `Promise`\<`unknown`\>
|
|
1062
1104
|
|
|
1063
1105
|
Starts a survey by its ID.
|
|
1064
1106
|
|
|
@@ -1072,6 +1114,7 @@ Starts a survey by its ID.
|
|
|
1072
1114
|
| `hiddenFields` | [`PropertyRecord`](README.md#propertyrecord) | `{}` |
|
|
1073
1115
|
| `hooks?` | [`HooksSurveyStart`](README.md#hookssurveystart) | `undefined` |
|
|
1074
1116
|
| `language?` | `string` | `undefined` |
|
|
1117
|
+
| `selectors?` | `string` \| `string`[] | `undefined` |
|
|
1075
1118
|
|
|
1076
1119
|
#### Returns
|
|
1077
1120
|
|
|
@@ -1086,15 +1129,16 @@ Screeb.surveyStart(
|
|
|
1086
1129
|
'<UUID>',
|
|
1087
1130
|
'<UUID>',
|
|
1088
1131
|
false,
|
|
1089
|
-
{
|
|
1132
|
+
{ // optional
|
|
1090
1133
|
color: "green",
|
|
1091
1134
|
article_id: 42
|
|
1092
1135
|
},
|
|
1093
|
-
{
|
|
1136
|
+
{ // optional
|
|
1094
1137
|
version: "1.0.0",
|
|
1095
1138
|
onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
1096
1139
|
},
|
|
1097
|
-
"en"
|
|
1140
|
+
"en", // optional
|
|
1141
|
+
"#screeb-survey-container" // optional
|
|
1098
1142
|
);
|
|
1099
1143
|
```
|
|
1100
1144
|
|