@tapfiliate/tapfiliate-js 1.1.0 → 1.1.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 CHANGED
@@ -67,6 +67,10 @@ To make the initialization easier we added the init function. Use Tap.init to in
67
67
 
68
68
  ## Changelog
69
69
 
70
+ ### 1.1.1
71
+
72
+ - `Tap.init` keeps reporting the integration as `npm-module` when you pass your own create options; before, passing any create options dropped it.
73
+
70
74
  ### 1.1.0
71
75
 
72
76
  - 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`.
package/dist/index.cjs CHANGED
@@ -34,7 +34,7 @@ const handler = {
34
34
  };
35
35
 
36
36
  const target = {
37
- init: (accountId, createOptions = { integration: "npm-module" }, createCallback, detectOptions = {}, detectCallback) => {
37
+ init: (accountId, createOptions, createCallback, detectOptions = {}, detectCallback) => {
38
38
  if (!inBrowser()) return;
39
39
 
40
40
  // Already set up: by a Tapfiliate snippet on the page, by an earlier init(), or tapfiliate.js has loaded
@@ -47,7 +47,10 @@ const target = {
47
47
  // create and detect go before the calls queued earlier: tapfiliate.js replays the queue in order, and a
48
48
  // conversion takes the account id from create.
49
49
  tap.q = tap.q || [];
50
- tap.q.unshift(["create", accountId, createOptions, createCallback], ["detect", detectOptions, detectCallback]);
50
+ // `integration` tells Tapfiliate the account tracks through this package; it stays when other create options are
51
+ // passed (1.1.0 and earlier dropped it then), and an explicit `integration` still wins.
52
+ var options = Object.assign({ integration: "npm-module" }, createOptions);
53
+ tap.q.unshift(["create", accountId, options, createCallback], ["detect", detectOptions, detectCallback]);
51
54
 
52
55
  var script = document.createElement("script");
53
56
  script.src = scriptSrc;
package/dist/index.mjs CHANGED
@@ -34,7 +34,7 @@ const handler = {
34
34
  };
35
35
 
36
36
  const target = {
37
- init: (accountId, createOptions = { integration: "npm-module" }, createCallback, detectOptions = {}, detectCallback) => {
37
+ init: (accountId, createOptions, createCallback, detectOptions = {}, detectCallback) => {
38
38
  if (!inBrowser()) return;
39
39
 
40
40
  // Already set up: by a Tapfiliate snippet on the page, by an earlier init(), or tapfiliate.js has loaded
@@ -47,7 +47,10 @@ const target = {
47
47
  // create and detect go before the calls queued earlier: tapfiliate.js replays the queue in order, and a
48
48
  // conversion takes the account id from create.
49
49
  tap.q = tap.q || [];
50
- tap.q.unshift(["create", accountId, createOptions, createCallback], ["detect", detectOptions, detectCallback]);
50
+ // `integration` tells Tapfiliate the account tracks through this package; it stays when other create options are
51
+ // passed (1.1.0 and earlier dropped it then), and an explicit `integration` still wins.
52
+ var options = Object.assign({ integration: "npm-module" }, createOptions);
53
+ tap.q.unshift(["create", accountId, options, createCallback], ["detect", detectOptions, detectCallback]);
51
54
 
52
55
  var script = document.createElement("script");
53
56
  script.src = scriptSrc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapfiliate/tapfiliate-js",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Simple wrapper for the Tapfiliate javascript integration library to help with implementation in modern frontend applications.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",