@tapfiliate/tapfiliate-js 1.0.2 → 1.1.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/LICENSE +15 -0
- package/README.md +19 -4
- package/dist/index.cjs +70 -0
- package/dist/index.d.ts +103 -0
- package/dist/index.mjs +69 -0
- package/package.json +31 -7
- package/index.js +0 -46
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Tapfiliate
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Tapfiliate npm module
|
|
2
2
|
|
|
3
|
-
This is a simple wrapper for the Tapfiliate [JavaScript integration](https://tapfiliate.com/
|
|
3
|
+
This is a simple wrapper for the Tapfiliate [JavaScript integration](https://developers.tapfiliate.com/tracking/javascript) library to help with implementation in modern frontend applications.
|
|
4
4
|
|
|
5
5
|
### Table of content
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ Import and initialize your tracking using the init function. Get your account id
|
|
|
24
24
|
|
|
25
25
|
`Tap.init(accountId);`
|
|
26
26
|
|
|
27
|
-
The init function will add the Tapfiliate script to your
|
|
27
|
+
The init function will add the Tapfiliate script to your website's head tag. This is needed for you to be able to use the rest of the Tap functions.
|
|
28
28
|
|
|
29
29
|
## Test your integration
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ Read more about testing your integration [here](https://support.tapfiliate.com/e
|
|
|
33
33
|
|
|
34
34
|
## API
|
|
35
35
|
|
|
36
|
-
This npm module mirrors the Tapfiliate [JavaScript integration](https://tapfiliate.com/
|
|
36
|
+
This npm module mirrors the Tapfiliate [JavaScript integration](https://developers.tapfiliate.com/tracking/javascript) library and all functions from the Javascript Docs can be used with this wrapper with the only difference that the first parameter is now the function name.
|
|
37
37
|
|
|
38
38
|
e.g. instead of:
|
|
39
39
|
`tap('conversion', external id, amount, options, commission type, callback);`
|
|
@@ -63,4 +63,19 @@ To make the initialization easier we added the init function. Use Tap.init to in
|
|
|
63
63
|
| cookie_domain | `string`. Explicitly define the domain to place the cookie on. Can be used when users land on subdomain A and later convert on subdomain B. |
|
|
64
64
|
| referral_code | `String` Use this to explicitly pass a specific referral code for this click. |
|
|
65
65
|
| referral_code_param | `String`. Use an alternative query parameter for the referral code, instead of ref. For example if you would like your links to look like: https://.../?via=, pass via |
|
|
66
|
-
| always_callback | `Boolean` Set to true to also make your callback fire on failed tracking attempts. [More info](https://tapfiliate.com/
|
|
66
|
+
| always_callback | `Boolean` Set to true to also make your callback fire on failed tracking attempts. [More info](https://developers.tapfiliate.com/tracking/javascript#callbacks) |
|
|
67
|
+
|
|
68
|
+
## Changelog
|
|
69
|
+
|
|
70
|
+
### 1.1.0
|
|
71
|
+
|
|
72
|
+
- Calls made before `Tap.init` are no longer lost: they wait in a queue and run right after `init`. Before, `Tap.conversion(...)` called too early threw `window.__tap is not a function`.
|
|
73
|
+
- Safe in server-side rendering: on the server (no `window`), `Tap.init` and all other methods do nothing instead of throwing. Tracking happens when the page runs in the browser.
|
|
74
|
+
- TypeScript types for the tracking methods (`conversion`, `conversionMulti`, `customer`, `trial`, `lead`, `click`, `detect`) and their options, so your editor shows the arguments.
|
|
75
|
+
|
|
76
|
+
### 1.0.3
|
|
77
|
+
|
|
78
|
+
- Works with `require()` and in server-side rendering. The package now ships both CommonJS and ES module builds, which fixes `SyntaxError: Unexpected token 'export'` in Next.js and Node.js 18–20 ([#1](https://github.com/tapfiliate/tapfiliate-js/issues/1)).
|
|
79
|
+
- TypeScript types included.
|
|
80
|
+
- `Tap` is no longer mistaken for a promise or a transpiled module by bundlers.
|
|
81
|
+
- If tapfiliate.js fails to load (for example, blocked by an ad blocker), a console warning names the script.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const scriptSrc = "https://script.tapfiliate.com/tapfiliate.js";
|
|
2
|
+
|
|
3
|
+
// Names that JavaScript itself and module loaders probe on any object. Forwarding them as tapfiliate.js
|
|
4
|
+
// methods made Tap look like a promise (`then`) or like a transpiled ES module (`__esModule`).
|
|
5
|
+
const notTapMethods = new Set(["then", "__esModule", "toJSON", "constructor"]);
|
|
6
|
+
|
|
7
|
+
// On the server (Next.js, Nuxt and other server-side rendering) there is no page to track: do nothing.
|
|
8
|
+
function inBrowser() {
|
|
9
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// The queue tapfiliate.js replays when it loads. Created on the first call, so calls made before init() are
|
|
13
|
+
// kept instead of failing. `npm` marks it as ours, unlike the queue of a Tapfiliate snippet already on the page.
|
|
14
|
+
function tapQueue() {
|
|
15
|
+
if (!window.__tap) {
|
|
16
|
+
window.TapfiliateObject = "__tap";
|
|
17
|
+
window.__tap = function() {
|
|
18
|
+
(window.__tap.q = window.__tap.q || []).push(arguments);
|
|
19
|
+
};
|
|
20
|
+
window.__tap.npm = true;
|
|
21
|
+
}
|
|
22
|
+
return window.__tap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const handler = {
|
|
26
|
+
get: function(target, name) {
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(target, name)) return target[name];
|
|
28
|
+
if (typeof name !== "string" || notTapMethods.has(name)) return undefined;
|
|
29
|
+
return (...args) => {
|
|
30
|
+
if (!inBrowser()) return;
|
|
31
|
+
tapQueue()(name, ...args);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const target = {
|
|
37
|
+
init: (accountId, createOptions = { integration: "npm-module" }, createCallback, detectOptions = {}, detectCallback) => {
|
|
38
|
+
if (!inBrowser()) return;
|
|
39
|
+
|
|
40
|
+
// Already set up: by a Tapfiliate snippet on the page, by an earlier init(), or tapfiliate.js has loaded
|
|
41
|
+
// (it replaces the queue with its own function).
|
|
42
|
+
if (window.__tap && (!window.__tap.npm || window.__tap.npmInitialized)) return;
|
|
43
|
+
|
|
44
|
+
var tap = tapQueue();
|
|
45
|
+
tap.npmInitialized = true;
|
|
46
|
+
|
|
47
|
+
// create and detect go before the calls queued earlier: tapfiliate.js replays the queue in order, and a
|
|
48
|
+
// conversion takes the account id from create.
|
|
49
|
+
tap.q = tap.q || [];
|
|
50
|
+
tap.q.unshift(["create", accountId, createOptions, createCallback], ["detect", detectOptions, detectCallback]);
|
|
51
|
+
|
|
52
|
+
var script = document.createElement("script");
|
|
53
|
+
script.src = scriptSrc;
|
|
54
|
+
script.type = "text/javascript";
|
|
55
|
+
script.async = true;
|
|
56
|
+
|
|
57
|
+
document.getElementsByTagName("head")[0].appendChild(script);
|
|
58
|
+
|
|
59
|
+
// Ad blockers routinely block the script. 1.0.2 stayed silent; an uncaught error here would flood
|
|
60
|
+
// every site's error monitoring once ^1.0.2 picks up this version, so it is a warning.
|
|
61
|
+
script.addEventListener("error", function() {
|
|
62
|
+
console.warn(`${this.src} failed to load.`);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var Tap = new Proxy(target, handler);
|
|
68
|
+
|
|
69
|
+
module.exports = Tap;
|
|
70
|
+
module.exports.default = Tap;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Types for the tapfiliate.js methods documented at https://developers.tapfiliate.com/tracking/javascript.
|
|
2
|
+
// Options stay open (`[option: string]: unknown`) so a new tapfiliate.js option does not need a new release.
|
|
3
|
+
|
|
4
|
+
/** Callbacks fire only on success unless `always_callback: true` is passed; then they get `(error, result)`. */
|
|
5
|
+
export type TapCallback = (...args: any[]) => void;
|
|
6
|
+
|
|
7
|
+
export interface TapCallbackOptions {
|
|
8
|
+
/** Also call the callback when tracking fails, with the signature `(error, result)`. */
|
|
9
|
+
always_callback?: boolean;
|
|
10
|
+
[option: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TapCreateOptions {
|
|
14
|
+
integration?: string;
|
|
15
|
+
[option: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface TapDetectOptions extends TapCallbackOptions {
|
|
19
|
+
/** Domain to set the cookie on, when visitors land on one subdomain and convert on another. */
|
|
20
|
+
cookie_domain?: string;
|
|
21
|
+
/** Referral code to use for this click instead of the one in the URL. */
|
|
22
|
+
referral_code?: string;
|
|
23
|
+
/** Query parameter that carries the referral code instead of `ref`, for example `via`. */
|
|
24
|
+
referral_code_param?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Extra data stored with a conversion or customer: up to 10 properties, no personal data. */
|
|
28
|
+
export type TapMetaData = Record<string, string | number | boolean>;
|
|
29
|
+
|
|
30
|
+
export interface TapConversionOptions extends TapCallbackOptions {
|
|
31
|
+
/** Your ID of the customer; with recurring commissions the conversion goes to the affiliate who referred them. */
|
|
32
|
+
customer_id?: string;
|
|
33
|
+
/** Three-letter ISO currency code, if it differs from the program currency. */
|
|
34
|
+
currency?: string;
|
|
35
|
+
/** Coupon codes used in the order. A coupon linked to an affiliate wins over the cookie. */
|
|
36
|
+
coupons?: string | string[];
|
|
37
|
+
meta_data?: TapMetaData;
|
|
38
|
+
/** Legacy: identifier of a program group. */
|
|
39
|
+
program_group?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface TapCustomerOptions extends TapCallbackOptions {
|
|
43
|
+
coupons?: string | string[];
|
|
44
|
+
meta_data?: TapMetaData;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TapCommission {
|
|
48
|
+
/** The part of the order amount for this commission. */
|
|
49
|
+
sub_amount: number;
|
|
50
|
+
/** Identifier of the commission type. */
|
|
51
|
+
commission_type: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** A referral code, or an asset ID and source ID. */
|
|
55
|
+
export interface TapTrackingParameters {
|
|
56
|
+
referral_code?: string;
|
|
57
|
+
asset_id?: string;
|
|
58
|
+
source_id?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface Tap {
|
|
62
|
+
/**
|
|
63
|
+
* Loads tapfiliate.js once, then runs `create` and `detect`. Calls made before `init` wait in a queue and run
|
|
64
|
+
* after it. On the server (no `window`) it does nothing, as do all other methods.
|
|
65
|
+
*/
|
|
66
|
+
init(
|
|
67
|
+
accountId: string,
|
|
68
|
+
createOptions?: TapCreateOptions,
|
|
69
|
+
createCallback?: TapCallback,
|
|
70
|
+
detectOptions?: TapDetectOptions,
|
|
71
|
+
detectCallback?: TapCallback
|
|
72
|
+
): void;
|
|
73
|
+
/** Records a click if the URL carries affiliate tracking parameters. `init` already calls it. */
|
|
74
|
+
detect(options?: TapDetectOptions, callback?: TapCallback): void;
|
|
75
|
+
/** Tracks a conversion, usually a purchase. A second conversion with the same `externalId` is not tracked. */
|
|
76
|
+
conversion(
|
|
77
|
+
externalId: string,
|
|
78
|
+
amount?: number | null,
|
|
79
|
+
options?: TapConversionOptions,
|
|
80
|
+
commissionType?: string | null,
|
|
81
|
+
callback?: TapCallback
|
|
82
|
+
): void;
|
|
83
|
+
/** Tracks one conversion with several commissions. */
|
|
84
|
+
conversionMulti(
|
|
85
|
+
externalId: string,
|
|
86
|
+
options: TapConversionOptions,
|
|
87
|
+
commissions: TapCommission[],
|
|
88
|
+
callback?: TapCallback
|
|
89
|
+
): void;
|
|
90
|
+
/** Tracks a referred customer at sign-up, before they pay. */
|
|
91
|
+
customer(customerId: string, options?: TapCustomerOptions, callback?: TapCallback): void;
|
|
92
|
+
/** Like `customer`, with the initial status trial. */
|
|
93
|
+
trial(customerId: string, options?: TapCustomerOptions, callback?: TapCallback): void;
|
|
94
|
+
/** Like `customer`, with the initial status lead. */
|
|
95
|
+
lead(customerId: string, options?: TapCustomerOptions, callback?: TapCallback): void;
|
|
96
|
+
/** Records a click from tracking parameters you pass explicitly. For standard setups use `detect`. */
|
|
97
|
+
click(trackingParameters: TapTrackingParameters, options?: TapCallbackOptions, callback?: TapCallback): void;
|
|
98
|
+
/** Any other tapfiliate.js method is forwarded as is. */
|
|
99
|
+
[method: string]: (...args: any[]) => void;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare const Tap: Tap;
|
|
103
|
+
export default Tap;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const scriptSrc = "https://script.tapfiliate.com/tapfiliate.js";
|
|
2
|
+
|
|
3
|
+
// Names that JavaScript itself and module loaders probe on any object. Forwarding them as tapfiliate.js
|
|
4
|
+
// methods made Tap look like a promise (`then`) or like a transpiled ES module (`__esModule`).
|
|
5
|
+
const notTapMethods = new Set(["then", "__esModule", "toJSON", "constructor"]);
|
|
6
|
+
|
|
7
|
+
// On the server (Next.js, Nuxt and other server-side rendering) there is no page to track: do nothing.
|
|
8
|
+
function inBrowser() {
|
|
9
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// The queue tapfiliate.js replays when it loads. Created on the first call, so calls made before init() are
|
|
13
|
+
// kept instead of failing. `npm` marks it as ours, unlike the queue of a Tapfiliate snippet already on the page.
|
|
14
|
+
function tapQueue() {
|
|
15
|
+
if (!window.__tap) {
|
|
16
|
+
window.TapfiliateObject = "__tap";
|
|
17
|
+
window.__tap = function() {
|
|
18
|
+
(window.__tap.q = window.__tap.q || []).push(arguments);
|
|
19
|
+
};
|
|
20
|
+
window.__tap.npm = true;
|
|
21
|
+
}
|
|
22
|
+
return window.__tap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const handler = {
|
|
26
|
+
get: function(target, name) {
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(target, name)) return target[name];
|
|
28
|
+
if (typeof name !== "string" || notTapMethods.has(name)) return undefined;
|
|
29
|
+
return (...args) => {
|
|
30
|
+
if (!inBrowser()) return;
|
|
31
|
+
tapQueue()(name, ...args);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const target = {
|
|
37
|
+
init: (accountId, createOptions = { integration: "npm-module" }, createCallback, detectOptions = {}, detectCallback) => {
|
|
38
|
+
if (!inBrowser()) return;
|
|
39
|
+
|
|
40
|
+
// Already set up: by a Tapfiliate snippet on the page, by an earlier init(), or tapfiliate.js has loaded
|
|
41
|
+
// (it replaces the queue with its own function).
|
|
42
|
+
if (window.__tap && (!window.__tap.npm || window.__tap.npmInitialized)) return;
|
|
43
|
+
|
|
44
|
+
var tap = tapQueue();
|
|
45
|
+
tap.npmInitialized = true;
|
|
46
|
+
|
|
47
|
+
// create and detect go before the calls queued earlier: tapfiliate.js replays the queue in order, and a
|
|
48
|
+
// conversion takes the account id from create.
|
|
49
|
+
tap.q = tap.q || [];
|
|
50
|
+
tap.q.unshift(["create", accountId, createOptions, createCallback], ["detect", detectOptions, detectCallback]);
|
|
51
|
+
|
|
52
|
+
var script = document.createElement("script");
|
|
53
|
+
script.src = scriptSrc;
|
|
54
|
+
script.type = "text/javascript";
|
|
55
|
+
script.async = true;
|
|
56
|
+
|
|
57
|
+
document.getElementsByTagName("head")[0].appendChild(script);
|
|
58
|
+
|
|
59
|
+
// Ad blockers routinely block the script. 1.0.2 stayed silent; an uncaught error here would flood
|
|
60
|
+
// every site's error monitoring once ^1.0.2 picks up this version, so it is a warning.
|
|
61
|
+
script.addEventListener("error", function() {
|
|
62
|
+
console.warn(`${this.src} failed to load.`);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var Tap = new Proxy(target, handler);
|
|
68
|
+
|
|
69
|
+
export default Tap;
|
package/package.json
CHANGED
|
@@ -1,19 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapfiliate/tapfiliate-js",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Simple wrapper for the Tapfiliate javascript integration library to help with implementation in modern frontend applications.",
|
|
5
|
-
"main": "index.
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false,
|
|
6
21
|
"scripts": {
|
|
7
|
-
"
|
|
22
|
+
"build": "node scripts/build.mjs",
|
|
23
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
24
|
+
"prepublishOnly": "npm test"
|
|
8
25
|
},
|
|
9
|
-
"
|
|
26
|
+
"keywords": [
|
|
27
|
+
"tapfiliate",
|
|
28
|
+
"affiliate",
|
|
29
|
+
"affiliate-tracking",
|
|
30
|
+
"referral",
|
|
31
|
+
"conversion-tracking"
|
|
32
|
+
],
|
|
33
|
+
"author": "Tapfiliate",
|
|
10
34
|
"license": "ISC",
|
|
11
35
|
"repository": {
|
|
12
36
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/
|
|
37
|
+
"url": "git+https://github.com/tapfiliate/tapfiliate-js.git"
|
|
14
38
|
},
|
|
15
|
-
"homepage": "https://
|
|
39
|
+
"homepage": "https://developers.tapfiliate.com/tracking/javascript",
|
|
16
40
|
"bugs": {
|
|
17
|
-
"url": "https://github.com/
|
|
41
|
+
"url": "https://github.com/tapfiliate/tapfiliate-js/issues"
|
|
18
42
|
}
|
|
19
43
|
}
|
package/index.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const handler = {
|
|
2
|
-
get: function (target, name) {
|
|
3
|
-
return target.hasOwnProperty(name)
|
|
4
|
-
? target[name]
|
|
5
|
-
: (...args) => {
|
|
6
|
-
window.__tap(name, ...args);
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const target = {
|
|
12
|
-
init: (
|
|
13
|
-
accountId,
|
|
14
|
-
createOptions = { integration: "npm-module" },
|
|
15
|
-
createCallback,
|
|
16
|
-
detectOptions = {},
|
|
17
|
-
detectCallback
|
|
18
|
-
) => {
|
|
19
|
-
if (window.__tap) return;
|
|
20
|
-
|
|
21
|
-
(function (t, a, p) {
|
|
22
|
-
t.TapfiliateObject = a;
|
|
23
|
-
t[a] =
|
|
24
|
-
t[a] ||
|
|
25
|
-
function () {
|
|
26
|
-
(t[a].q = t[a].q || []).push(arguments);
|
|
27
|
-
};
|
|
28
|
-
})(window, "__tap");
|
|
29
|
-
|
|
30
|
-
var script = document.createElement("script");
|
|
31
|
-
script.src = "https://script.tapfiliate.com/tapfiliate.js";
|
|
32
|
-
script.type = "text/javascript";
|
|
33
|
-
script.async = true;
|
|
34
|
-
|
|
35
|
-
document.getElementsByTagName("head")[0].appendChild(script);
|
|
36
|
-
script.addEventListener("error", () => {
|
|
37
|
-
new Error(`${this.src} failed to load.`);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
window.__tap("create", accountId, createOptions, createCallback);
|
|
41
|
-
window.__tap("detect", detectOptions, detectCallback);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var Tap = new Proxy(target, handler);
|
|
45
|
-
|
|
46
|
-
export default Tap;
|