@screeb/sdk-browser 0.4.0 → 0.6.1
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/README.md +35 -7
- package/dist/cjs/index.cjs +14 -10
- package/dist/cjs/index.d.ts +7 -4
- package/dist/cjs/types.d.ts +30 -0
- package/dist/es/index.d.ts +7 -4
- package/dist/es/index.mjs +14 -10
- package/dist/es/types.d.ts +30 -0
- package/docs/README.md +35 -4
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://screeb.app" alt="Screeb">
|
|
3
|
-
<img src="https://raw.githubusercontent.com/ScreebApp/sdk
|
|
3
|
+
<img src="https://raw.githubusercontent.com/ScreebApp/sdk/master/packages/sdk-browser/readme/screeb-logo.svg" alt="Logo" height="120px" style="margin-top: 20px;"/>
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
<h1 align="center">@screeb/sdk-browser</h1>
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
|
-
<a href="https://github.com/ScreebApp/sdk
|
|
17
|
-
<img alt="ci" src="https://github.com/ScreebApp/sdk
|
|
16
|
+
<a href="https://github.com/ScreebApp/sdk/actions/workflows/ci.yml" alt="ci">
|
|
17
|
+
<img alt="ci" src="https://github.com/ScreebApp/sdk/actions/workflows/ci.yml/badge.svg">
|
|
18
18
|
</a>
|
|
19
19
|
<a href="https://www.npmjs.com/package/@screeb/sdk-browser" alt="version">
|
|
20
20
|
<img alt="version" src="https://img.shields.io/npm/v/@screeb/sdk-browser.svg" />
|
|
@@ -50,11 +50,39 @@ Screeb.load();
|
|
|
50
50
|
Screeb.init('<your-website-id>');
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
### Custom domains (AdBlocker bypass)
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
If you route Screeb traffic through your own domain (reverse proxy) to bypass AdBlockers, pass an
|
|
56
|
+
`endpoints` object to `load()`. Only the endpoints you provide are overridden; the rest fall back
|
|
57
|
+
to Screeb's defaults. The tag loader URL itself is set separately via `screebEndpoint`.
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
```ts
|
|
60
|
+
import * as Screeb from "@screeb/sdk-browser";
|
|
61
|
+
|
|
62
|
+
Screeb.load({
|
|
63
|
+
// Load the SDK bundle from your domain
|
|
64
|
+
screebEndpoint: "https://analytics.acme.com/sdk/tag.js",
|
|
65
|
+
// Route collector traffic through your domain
|
|
66
|
+
endpoints: {
|
|
67
|
+
rpc: "https://analytics.acme.com/rpc",
|
|
68
|
+
static: "https://analytics.acme.com/static",
|
|
69
|
+
report: "https://analytics.acme.com/report",
|
|
70
|
+
hostedPage: "https://analytics.acme.com/hosted-page",
|
|
71
|
+
centipede: "wss://analytics.acme.com/centipede",
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
Screeb.init('<your-website-id>');
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
All endpoints must use `https://` (or `wss://` for `centipede`) and the domains must be allow-listed
|
|
78
|
+
in **Screeb Admin → Settings → Custom Domains**. See the
|
|
79
|
+
[Custom Collector URL guide](https://developers.screeb.app/sdk-js/custom-collector-url).
|
|
80
|
+
|
|
81
|
+
For a working example, see our [Screeb Browser SDK example app](https://github.com/ScreebApp/sdk/tree/master/examples/example-browser).
|
|
82
|
+
|
|
83
|
+
For a more advanced usage and a complete API documentation, see [documentation generated from source files](https://github.com/ScreebApp/sdk/tree/master/packages/sdk-browser/docs).
|
|
84
|
+
|
|
85
|
+
For further information, see [our developer documentation](https://developers.screeb.app/sdk-js/install).
|
|
58
86
|
|
|
59
87
|
## Support
|
|
60
88
|
For any issues, please contact our support team at support@screeb.com.
|
|
@@ -64,4 +92,4 @@ All third party contributors acknowledge that any contributions they provide wil
|
|
|
64
92
|
|
|
65
93
|
## License
|
|
66
94
|
|
|
67
|
-
Released under [MIT License](https://github.com/ScreebApp/sdk
|
|
95
|
+
Released under [MIT License](https://github.com/ScreebApp/sdk/blob/master/LICENSE).
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
14
14
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
15
|
PERFORMANCE OF THIS SOFTWARE.
|
|
16
16
|
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
17
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var __assign = function() {
|
|
@@ -52,6 +52,8 @@ var callScreebCommand = function () {
|
|
|
52
52
|
* @param options Screeb module options.
|
|
53
53
|
* @param options.window If you're running Screeb tag in an iframe, please set the inner window here.
|
|
54
54
|
* @param options.screebEndpoint Please don't do this.
|
|
55
|
+
* @param options.endpoints Override Screeb's collector URLs to route traffic through your own
|
|
56
|
+
* domain (custom domains / AdBlocker bypass). Only the endpoints you provide are overridden.
|
|
55
57
|
*
|
|
56
58
|
* @example
|
|
57
59
|
* ```ts
|
|
@@ -70,8 +72,8 @@ var load = function (options) {
|
|
|
70
72
|
scriptElement.src = (_b = options.screebEndpoint) !== null && _b !== void 0 ? _b : SCREEB_TAG_ENDPOINT;
|
|
71
73
|
scriptElement.addEventListener("load", function () { return resolve(undefined); });
|
|
72
74
|
scriptElement.addEventListener("error", reject);
|
|
73
|
-
if (options.platform) {
|
|
74
|
-
_window["ScreebConfig"] = { platform: options.platform };
|
|
75
|
+
if (options.platform || options.endpoints) {
|
|
76
|
+
_window["ScreebConfig"] = __assign(__assign({}, (options.platform ? { platform: options.platform } : {})), (options.endpoints ? { endpoints: options.endpoints } : {}));
|
|
75
77
|
}
|
|
76
78
|
_window.$screeb =
|
|
77
79
|
(_c = _window.$screeb) !== null && _c !== void 0 ? _c : function () {
|
|
@@ -414,27 +416,29 @@ var surveyClose = function () { return callScreebCommand("survey.close"); };
|
|
|
414
416
|
* '<UUID>',
|
|
415
417
|
* '<UUID>',
|
|
416
418
|
* false,
|
|
417
|
-
* {
|
|
419
|
+
* { // optional
|
|
418
420
|
* color: "green",
|
|
419
421
|
* article_id: 42
|
|
420
422
|
* },
|
|
421
|
-
* {
|
|
423
|
+
* { // optional
|
|
422
424
|
* version: "1.0.0",
|
|
423
425
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
424
426
|
* },
|
|
425
|
-
* "en"
|
|
427
|
+
* "en", // optional
|
|
428
|
+
* "#screeb-survey-container" // optional
|
|
426
429
|
* );
|
|
427
430
|
* ```
|
|
428
431
|
*/
|
|
429
|
-
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) {
|
|
432
|
+
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors) {
|
|
430
433
|
if (allowMultipleResponses === void 0) { allowMultipleResponses = true; }
|
|
431
434
|
if (hiddenFields === void 0) { hiddenFields = {}; }
|
|
432
435
|
return callScreebCommand("survey.start", surveyId, {
|
|
433
|
-
distribution_id: distributionId,
|
|
434
436
|
allow_multiple_responses: allowMultipleResponses,
|
|
435
|
-
|
|
437
|
+
distribution_id: distributionId,
|
|
436
438
|
hidden_fields: hiddenFields,
|
|
437
439
|
hooks: hooks,
|
|
440
|
+
language: language,
|
|
441
|
+
selectors: selectors,
|
|
438
442
|
});
|
|
439
443
|
};
|
|
440
444
|
/**
|
|
@@ -561,4 +565,4 @@ exports.surveyClose = surveyClose;
|
|
|
561
565
|
exports.surveyStart = surveyStart;
|
|
562
566
|
exports.targetingCheck = targetingCheck;
|
|
563
567
|
exports.targetingDebug = targetingDebug;
|
|
564
|
-
CONSTANTS.version = '0.
|
|
568
|
+
CONSTANTS.version = '0.6.1'
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from "./hooks.types";
|
|
|
8
8
|
* @param options Screeb module options.
|
|
9
9
|
* @param options.window If you're running Screeb tag in an iframe, please set the inner window here.
|
|
10
10
|
* @param options.screebEndpoint Please don't do this.
|
|
11
|
+
* @param options.endpoints Override Screeb's collector URLs to route traffic through your own
|
|
12
|
+
* domain (custom domains / AdBlocker bypass). Only the endpoints you provide are overridden.
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* ```ts
|
|
@@ -304,19 +306,20 @@ export declare const surveyClose: () => void | Promise<unknown>;
|
|
|
304
306
|
* '<UUID>',
|
|
305
307
|
* '<UUID>',
|
|
306
308
|
* false,
|
|
307
|
-
* {
|
|
309
|
+
* { // optional
|
|
308
310
|
* color: "green",
|
|
309
311
|
* article_id: 42
|
|
310
312
|
* },
|
|
311
|
-
* {
|
|
313
|
+
* { // optional
|
|
312
314
|
* version: "1.0.0",
|
|
313
315
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
314
316
|
* },
|
|
315
|
-
* "en"
|
|
317
|
+
* "en", // optional
|
|
318
|
+
* "#screeb-survey-container" // optional
|
|
316
319
|
* );
|
|
317
320
|
* ```
|
|
318
321
|
*/
|
|
319
|
-
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => void | Promise<unknown>;
|
|
322
|
+
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string, selectors?: string | string[]) => void | Promise<unknown>;
|
|
320
323
|
/**
|
|
321
324
|
* Interrupts a running message.
|
|
322
325
|
*
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -4,6 +4,28 @@ export type PropertyType = number | boolean | string | Date | PropertyRecord;
|
|
|
4
4
|
export type PropertyRecord = {
|
|
5
5
|
[key: string]: PropertyType | PropertyType[];
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Custom collector URLs used to bypass AdBlockers by routing Screeb traffic
|
|
9
|
+
* through your own domain (reverse proxy).
|
|
10
|
+
*
|
|
11
|
+
* Every key is optional: any omitted endpoint falls back to Screeb's default
|
|
12
|
+
* URL. All endpoints must use `https://` (or `wss://` for the WebSocket one),
|
|
13
|
+
* and the domains must be allow-listed in Screeb Admin → Settings → Custom Domains.
|
|
14
|
+
*
|
|
15
|
+
* @see https://developers.screeb.app/sdk-js/custom-collector-url
|
|
16
|
+
*/
|
|
17
|
+
export type ScreebEndpoints = {
|
|
18
|
+
/** REST API (surveys, tracking). Default: `https://rpc.screeb.app/rpc`. */
|
|
19
|
+
rpc?: string;
|
|
20
|
+
/** Static assets (images, fonts). Default: `https://static.screeb.app`. */
|
|
21
|
+
static?: string;
|
|
22
|
+
/** Response reporting. Default: `https://r.screeb.app/rpc`. */
|
|
23
|
+
report?: string;
|
|
24
|
+
/** Hosted survey page. Default: `https://survey.screeb.app`. */
|
|
25
|
+
hostedPage?: string;
|
|
26
|
+
/** WebSocket (real-time targeting). Default: `wss://centipede.screeb.app`. */
|
|
27
|
+
centipede?: string;
|
|
28
|
+
};
|
|
7
29
|
/** This is the Screeb tag options object. */
|
|
8
30
|
export type ScreebOptions = {
|
|
9
31
|
/** If you're running Screeb tag in an iframe, please set the inner window here. */
|
|
@@ -14,6 +36,14 @@ export type ScreebOptions = {
|
|
|
14
36
|
sdkVersion?: string;
|
|
15
37
|
/** Please don't do this. */
|
|
16
38
|
screebEndpoint?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Override Screeb's collector URLs to route traffic through your own domain
|
|
41
|
+
* (custom domains / AdBlocker bypass). Only the endpoints you provide are
|
|
42
|
+
* overridden; the rest fall back to Screeb's defaults.
|
|
43
|
+
*
|
|
44
|
+
* @see https://developers.screeb.app/sdk-js/custom-collector-url
|
|
45
|
+
*/
|
|
46
|
+
endpoints?: ScreebEndpoints;
|
|
17
47
|
/** @hidden Use a specific platform */
|
|
18
48
|
platform?: string;
|
|
19
49
|
};
|
package/dist/es/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from "./hooks.types";
|
|
|
8
8
|
* @param options Screeb module options.
|
|
9
9
|
* @param options.window If you're running Screeb tag in an iframe, please set the inner window here.
|
|
10
10
|
* @param options.screebEndpoint Please don't do this.
|
|
11
|
+
* @param options.endpoints Override Screeb's collector URLs to route traffic through your own
|
|
12
|
+
* domain (custom domains / AdBlocker bypass). Only the endpoints you provide are overridden.
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* ```ts
|
|
@@ -304,19 +306,20 @@ export declare const surveyClose: () => void | Promise<unknown>;
|
|
|
304
306
|
* '<UUID>',
|
|
305
307
|
* '<UUID>',
|
|
306
308
|
* false,
|
|
307
|
-
* {
|
|
309
|
+
* { // optional
|
|
308
310
|
* color: "green",
|
|
309
311
|
* article_id: 42
|
|
310
312
|
* },
|
|
311
|
-
* {
|
|
313
|
+
* { // optional
|
|
312
314
|
* version: "1.0.0",
|
|
313
315
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
314
316
|
* },
|
|
315
|
-
* "en"
|
|
317
|
+
* "en", // optional
|
|
318
|
+
* "#screeb-survey-container" // optional
|
|
316
319
|
* );
|
|
317
320
|
* ```
|
|
318
321
|
*/
|
|
319
|
-
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string) => void | Promise<unknown>;
|
|
322
|
+
export declare const surveyStart: (surveyId: string, distributionId?: string, allowMultipleResponses?: boolean, hiddenFields?: PropertyRecord, hooks?: HooksSurveyStart, language?: string, selectors?: string | string[]) => void | Promise<unknown>;
|
|
320
323
|
/**
|
|
321
324
|
* Interrupts a running message.
|
|
322
325
|
*
|
package/dist/es/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
12
12
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
13
|
PERFORMANCE OF THIS SOFTWARE.
|
|
14
14
|
***************************************************************************** */
|
|
15
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
15
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var __assign = function() {
|
|
@@ -50,6 +50,8 @@ var callScreebCommand = function () {
|
|
|
50
50
|
* @param options Screeb module options.
|
|
51
51
|
* @param options.window If you're running Screeb tag in an iframe, please set the inner window here.
|
|
52
52
|
* @param options.screebEndpoint Please don't do this.
|
|
53
|
+
* @param options.endpoints Override Screeb's collector URLs to route traffic through your own
|
|
54
|
+
* domain (custom domains / AdBlocker bypass). Only the endpoints you provide are overridden.
|
|
53
55
|
*
|
|
54
56
|
* @example
|
|
55
57
|
* ```ts
|
|
@@ -68,8 +70,8 @@ var load = function (options) {
|
|
|
68
70
|
scriptElement.src = (_b = options.screebEndpoint) !== null && _b !== void 0 ? _b : SCREEB_TAG_ENDPOINT;
|
|
69
71
|
scriptElement.addEventListener("load", function () { return resolve(undefined); });
|
|
70
72
|
scriptElement.addEventListener("error", reject);
|
|
71
|
-
if (options.platform) {
|
|
72
|
-
_window["ScreebConfig"] = { platform: options.platform };
|
|
73
|
+
if (options.platform || options.endpoints) {
|
|
74
|
+
_window["ScreebConfig"] = __assign(__assign({}, (options.platform ? { platform: options.platform } : {})), (options.endpoints ? { endpoints: options.endpoints } : {}));
|
|
73
75
|
}
|
|
74
76
|
_window.$screeb =
|
|
75
77
|
(_c = _window.$screeb) !== null && _c !== void 0 ? _c : function () {
|
|
@@ -412,27 +414,29 @@ var surveyClose = function () { return callScreebCommand("survey.close"); };
|
|
|
412
414
|
* '<UUID>',
|
|
413
415
|
* '<UUID>',
|
|
414
416
|
* false,
|
|
415
|
-
* {
|
|
417
|
+
* { // optional
|
|
416
418
|
* color: "green",
|
|
417
419
|
* article_id: 42
|
|
418
420
|
* },
|
|
419
|
-
* {
|
|
421
|
+
* { // optional
|
|
420
422
|
* version: "1.0.0",
|
|
421
423
|
* onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
422
424
|
* },
|
|
423
|
-
* "en"
|
|
425
|
+
* "en", // optional
|
|
426
|
+
* "#screeb-survey-container" // optional
|
|
424
427
|
* );
|
|
425
428
|
* ```
|
|
426
429
|
*/
|
|
427
|
-
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language) {
|
|
430
|
+
var surveyStart = function (surveyId, distributionId, allowMultipleResponses, hiddenFields, hooks, language, selectors) {
|
|
428
431
|
if (allowMultipleResponses === void 0) { allowMultipleResponses = true; }
|
|
429
432
|
if (hiddenFields === void 0) { hiddenFields = {}; }
|
|
430
433
|
return callScreebCommand("survey.start", surveyId, {
|
|
431
|
-
distribution_id: distributionId,
|
|
432
434
|
allow_multiple_responses: allowMultipleResponses,
|
|
433
|
-
|
|
435
|
+
distribution_id: distributionId,
|
|
434
436
|
hidden_fields: hiddenFields,
|
|
435
437
|
hooks: hooks,
|
|
438
|
+
language: language,
|
|
439
|
+
selectors: selectors,
|
|
436
440
|
});
|
|
437
441
|
};
|
|
438
442
|
/**
|
|
@@ -540,4 +544,4 @@ var targetingCheck = function () { return callScreebCommand("targeting.check");
|
|
|
540
544
|
var targetingDebug = function () { return callScreebCommand("targeting.debug"); };
|
|
541
545
|
|
|
542
546
|
export { close, debug, eventTrack, identity, identityGet, identityGroupAssign, identityGroupUnassign, identityProperties, identityReset, init, isLoaded, load, messageClose, messageStart, sessionReplayStart, sessionReplayStop, surveyClose, surveyStart, targetingCheck, targetingDebug };
|
|
543
|
-
CONSTANTS.version = '0.
|
|
547
|
+
CONSTANTS.version = '0.6.1'
|
package/dist/es/types.d.ts
CHANGED
|
@@ -4,6 +4,28 @@ export type PropertyType = number | boolean | string | Date | PropertyRecord;
|
|
|
4
4
|
export type PropertyRecord = {
|
|
5
5
|
[key: string]: PropertyType | PropertyType[];
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Custom collector URLs used to bypass AdBlockers by routing Screeb traffic
|
|
9
|
+
* through your own domain (reverse proxy).
|
|
10
|
+
*
|
|
11
|
+
* Every key is optional: any omitted endpoint falls back to Screeb's default
|
|
12
|
+
* URL. All endpoints must use `https://` (or `wss://` for the WebSocket one),
|
|
13
|
+
* and the domains must be allow-listed in Screeb Admin → Settings → Custom Domains.
|
|
14
|
+
*
|
|
15
|
+
* @see https://developers.screeb.app/sdk-js/custom-collector-url
|
|
16
|
+
*/
|
|
17
|
+
export type ScreebEndpoints = {
|
|
18
|
+
/** REST API (surveys, tracking). Default: `https://rpc.screeb.app/rpc`. */
|
|
19
|
+
rpc?: string;
|
|
20
|
+
/** Static assets (images, fonts). Default: `https://static.screeb.app`. */
|
|
21
|
+
static?: string;
|
|
22
|
+
/** Response reporting. Default: `https://r.screeb.app/rpc`. */
|
|
23
|
+
report?: string;
|
|
24
|
+
/** Hosted survey page. Default: `https://survey.screeb.app`. */
|
|
25
|
+
hostedPage?: string;
|
|
26
|
+
/** WebSocket (real-time targeting). Default: `wss://centipede.screeb.app`. */
|
|
27
|
+
centipede?: string;
|
|
28
|
+
};
|
|
7
29
|
/** This is the Screeb tag options object. */
|
|
8
30
|
export type ScreebOptions = {
|
|
9
31
|
/** If you're running Screeb tag in an iframe, please set the inner window here. */
|
|
@@ -14,6 +36,14 @@ export type ScreebOptions = {
|
|
|
14
36
|
sdkVersion?: string;
|
|
15
37
|
/** Please don't do this. */
|
|
16
38
|
screebEndpoint?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Override Screeb's collector URLs to route traffic through your own domain
|
|
41
|
+
* (custom domains / AdBlocker bypass). Only the endpoints you provide are
|
|
42
|
+
* overridden; the rest fall back to Screeb's defaults.
|
|
43
|
+
*
|
|
44
|
+
* @see https://developers.screeb.app/sdk-js/custom-collector-url
|
|
45
|
+
*/
|
|
46
|
+
endpoints?: ScreebEndpoints;
|
|
17
47
|
/** @hidden Use a specific platform */
|
|
18
48
|
platform?: string;
|
|
19
49
|
};
|
package/docs/README.md
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
- [ResponseItemAnswer](README.md#responseitemanswer)
|
|
34
34
|
- [ResponseItemQuestion](README.md#responseitemquestion)
|
|
35
35
|
- [ResponseStatus](README.md#responsestatus)
|
|
36
|
+
- [ScreebEndpoints](README.md#screebendpoints)
|
|
36
37
|
- [ScreebFunction](README.md#screebfunction)
|
|
37
38
|
- [ScreebIdentityGetReturn](README.md#screebidentitygetreturn)
|
|
38
39
|
- [ScreebObject](README.md#screebobject)
|
|
@@ -478,6 +479,33 @@ ___
|
|
|
478
479
|
|
|
479
480
|
___
|
|
480
481
|
|
|
482
|
+
### ScreebEndpoints
|
|
483
|
+
|
|
484
|
+
Ƭ **ScreebEndpoints**: `Object`
|
|
485
|
+
|
|
486
|
+
Custom collector URLs used to bypass AdBlockers by routing Screeb traffic
|
|
487
|
+
through your own domain (reverse proxy).
|
|
488
|
+
|
|
489
|
+
Every key is optional: any omitted endpoint falls back to Screeb's default
|
|
490
|
+
URL. All endpoints must use `https://` (or `wss://` for the WebSocket one),
|
|
491
|
+
and the domains must be allow-listed in Screeb Admin → Settings → Custom Domains.
|
|
492
|
+
|
|
493
|
+
**`See`**
|
|
494
|
+
|
|
495
|
+
https://developers.screeb.app/sdk-js/custom-collector-url
|
|
496
|
+
|
|
497
|
+
#### Type declaration
|
|
498
|
+
|
|
499
|
+
| Name | Type | Description |
|
|
500
|
+
| :------ | :------ | :------ |
|
|
501
|
+
| `centipede?` | `string` | WebSocket (real-time targeting). Default: `wss://centipede.screeb.app`. |
|
|
502
|
+
| `hostedPage?` | `string` | Hosted survey page. Default: `https://survey.screeb.app`. |
|
|
503
|
+
| `report?` | `string` | Response reporting. Default: `https://r.screeb.app/rpc`. |
|
|
504
|
+
| `rpc?` | `string` | REST API (surveys, tracking). Default: `https://rpc.screeb.app/rpc`. |
|
|
505
|
+
| `static?` | `string` | Static assets (images, fonts). Default: `https://static.screeb.app`. |
|
|
506
|
+
|
|
507
|
+
___
|
|
508
|
+
|
|
481
509
|
### ScreebFunction
|
|
482
510
|
|
|
483
511
|
Ƭ **ScreebFunction**: (...`_`: `unknown`[]) => `void` \| `Promise`\<`unknown`\>
|
|
@@ -536,6 +564,7 @@ This is the Screeb tag options object.
|
|
|
536
564
|
|
|
537
565
|
| Name | Type | Description |
|
|
538
566
|
| :------ | :------ | :------ |
|
|
567
|
+
| `endpoints?` | [`ScreebEndpoints`](README.md#screebendpoints) | Override Screeb's collector URLs to route traffic through your own domain (custom domains / AdBlocker bypass). Only the endpoints you provide are overridden; the rest fall back to Screeb's defaults. **`See`** https://developers.screeb.app/sdk-js/custom-collector-url |
|
|
539
568
|
| `screebEndpoint?` | `string` | Please don't do this. |
|
|
540
569
|
| `sdkName?` | `string` | SDK name (eg: sdk-browser, sdk-react, sdk-angular, etc...) |
|
|
541
570
|
| `sdkVersion?` | `string` | SDK version (eg: 1.2.3) |
|
|
@@ -1100,7 +1129,7 @@ ___
|
|
|
1100
1129
|
|
|
1101
1130
|
### surveyStart
|
|
1102
1131
|
|
|
1103
|
-
▸ **surveyStart**(`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`): `void` \| `Promise`\<`unknown`\>
|
|
1132
|
+
▸ **surveyStart**(`surveyId`, `distributionId?`, `allowMultipleResponses?`, `hiddenFields?`, `hooks?`, `language?`, `selectors?`): `void` \| `Promise`\<`unknown`\>
|
|
1104
1133
|
|
|
1105
1134
|
Starts a survey by its ID.
|
|
1106
1135
|
|
|
@@ -1114,6 +1143,7 @@ Starts a survey by its ID.
|
|
|
1114
1143
|
| `hiddenFields` | [`PropertyRecord`](README.md#propertyrecord) | `{}` |
|
|
1115
1144
|
| `hooks?` | [`HooksSurveyStart`](README.md#hookssurveystart) | `undefined` |
|
|
1116
1145
|
| `language?` | `string` | `undefined` |
|
|
1146
|
+
| `selectors?` | `string` \| `string`[] | `undefined` |
|
|
1117
1147
|
|
|
1118
1148
|
#### Returns
|
|
1119
1149
|
|
|
@@ -1128,15 +1158,16 @@ Screeb.surveyStart(
|
|
|
1128
1158
|
'<UUID>',
|
|
1129
1159
|
'<UUID>',
|
|
1130
1160
|
false,
|
|
1131
|
-
{
|
|
1161
|
+
{ // optional
|
|
1132
1162
|
color: "green",
|
|
1133
1163
|
article_id: 42
|
|
1134
1164
|
},
|
|
1135
|
-
{
|
|
1165
|
+
{ // optional
|
|
1136
1166
|
version: "1.0.0",
|
|
1137
1167
|
onSurveyShowed: (payload) => console.log("Survey showed", payload),
|
|
1138
1168
|
},
|
|
1139
|
-
"en"
|
|
1169
|
+
"en", // optional
|
|
1170
|
+
"#screeb-survey-container" // optional
|
|
1140
1171
|
);
|
|
1141
1172
|
```
|
|
1142
1173
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@screeb/sdk-browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Screeb's browser sdk.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"product discovery",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
],
|
|
14
14
|
"homepage": "https://screeb.app",
|
|
15
15
|
"bugs": {
|
|
16
|
-
"url": "https://github.com/ScreebApp/sdk
|
|
16
|
+
"url": "https://github.com/ScreebApp/sdk/issues",
|
|
17
17
|
"email": "support@screeb.app"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/ScreebApp/sdk
|
|
22
|
-
"directory": "packages/
|
|
21
|
+
"url": "https://github.com/ScreebApp/sdk.git",
|
|
22
|
+
"directory": "packages/sdk-browser"
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"author": "Screeb's frontend team",
|
|
@@ -41,21 +41,21 @@
|
|
|
41
41
|
"test": "echo 'test disabled'"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@screeb/eslint-config": "^0.1.
|
|
45
|
-
"@screeb/typescript-config": "^0.1.
|
|
46
|
-
"@types/jest": "^29.5.
|
|
47
|
-
"@types/node": "^20.8.
|
|
44
|
+
"@screeb/eslint-config": "^0.1.7",
|
|
45
|
+
"@screeb/typescript-config": "^0.1.12",
|
|
46
|
+
"@types/jest": "^29.5.14",
|
|
47
|
+
"@types/node": "^20.8.10",
|
|
48
48
|
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
|
49
49
|
"eslint": "^8.51.0",
|
|
50
50
|
"eslint-plugin-import": "^2.28.1",
|
|
51
|
-
"eslint-plugin-jest": "^27.4.
|
|
51
|
+
"eslint-plugin-jest": "^27.4.3",
|
|
52
52
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
53
53
|
"eslint-plugin-prettier": "^5.0.1",
|
|
54
54
|
"jest": "^29.7.0",
|
|
55
55
|
"jest-environment-jsdom": "^29.7.0",
|
|
56
56
|
"prettier": "^3.0.3",
|
|
57
57
|
"rollup": "^4.0.2",
|
|
58
|
-
"ts-jest": "^29.1.
|
|
58
|
+
"ts-jest": "^29.1.5",
|
|
59
59
|
"typedoc": "^0.25.2",
|
|
60
60
|
"typedoc-plugin-markdown": "^3.16.0"
|
|
61
61
|
},
|