@amplitude/analytics-browser 0.3.1 → 0.4.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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/lib/cjs/attribution.d.ts +1 -1
  4. package/lib/cjs/attribution.d.ts.map +1 -1
  5. package/lib/cjs/attribution.js +5 -17
  6. package/lib/cjs/attribution.js.map +1 -1
  7. package/lib/cjs/browser-client.d.ts +96 -81
  8. package/lib/cjs/browser-client.d.ts.map +1 -1
  9. package/lib/cjs/browser-client.js +194 -196
  10. package/lib/cjs/browser-client.js.map +1 -1
  11. package/lib/cjs/config.d.ts +11 -7
  12. package/lib/cjs/config.d.ts.map +1 -1
  13. package/lib/cjs/config.js +33 -34
  14. package/lib/cjs/config.js.map +1 -1
  15. package/lib/cjs/cookie-migration/index.d.ts +5 -0
  16. package/lib/cjs/cookie-migration/index.d.ts.map +1 -0
  17. package/lib/cjs/cookie-migration/index.js +55 -0
  18. package/lib/cjs/cookie-migration/index.js.map +1 -0
  19. package/lib/cjs/plugins/context.js +1 -1
  20. package/lib/cjs/plugins/context.js.map +1 -1
  21. package/lib/cjs/session-manager.d.ts +3 -3
  22. package/lib/cjs/session-manager.d.ts.map +1 -1
  23. package/lib/cjs/session-manager.js +10 -16
  24. package/lib/cjs/session-manager.js.map +1 -1
  25. package/lib/cjs/storage/cookie.d.ts +2 -2
  26. package/lib/cjs/storage/cookie.d.ts.map +1 -1
  27. package/lib/cjs/storage/cookie.js +16 -11
  28. package/lib/cjs/storage/cookie.js.map +1 -1
  29. package/lib/cjs/storage/local-storage.d.ts +1 -0
  30. package/lib/cjs/storage/local-storage.d.ts.map +1 -1
  31. package/lib/cjs/storage/local-storage.js +4 -1
  32. package/lib/cjs/storage/local-storage.js.map +1 -1
  33. package/lib/cjs/storage/memory.d.ts +1 -0
  34. package/lib/cjs/storage/memory.d.ts.map +1 -1
  35. package/lib/cjs/storage/memory.js +4 -0
  36. package/lib/cjs/storage/memory.js.map +1 -1
  37. package/lib/cjs/storage/utm-cookie.js +1 -1
  38. package/lib/cjs/storage/utm-cookie.js.map +1 -1
  39. package/lib/cjs/utils/snippet-helper.d.ts +1 -0
  40. package/lib/cjs/utils/snippet-helper.d.ts.map +1 -1
  41. package/lib/cjs/utils/snippet-helper.js +1 -0
  42. package/lib/cjs/utils/snippet-helper.js.map +1 -1
  43. package/lib/cjs/version.d.ts +1 -1
  44. package/lib/cjs/version.js +1 -1
  45. package/lib/cjs/version.js.map +1 -1
  46. package/lib/esm/attribution.d.ts +1 -1
  47. package/lib/esm/attribution.d.ts.map +1 -1
  48. package/lib/esm/attribution.js +4 -16
  49. package/lib/esm/attribution.js.map +1 -1
  50. package/lib/esm/browser-client.d.ts +96 -81
  51. package/lib/esm/browser-client.d.ts.map +1 -1
  52. package/lib/esm/browser-client.js +197 -182
  53. package/lib/esm/browser-client.js.map +1 -1
  54. package/lib/esm/config.d.ts +11 -7
  55. package/lib/esm/config.d.ts.map +1 -1
  56. package/lib/esm/config.js +28 -29
  57. package/lib/esm/config.js.map +1 -1
  58. package/lib/esm/cookie-migration/index.d.ts +5 -0
  59. package/lib/esm/cookie-migration/index.d.ts.map +1 -0
  60. package/lib/esm/cookie-migration/index.js +50 -0
  61. package/lib/esm/cookie-migration/index.js.map +1 -0
  62. package/lib/esm/plugins/context.js +2 -2
  63. package/lib/esm/plugins/context.js.map +1 -1
  64. package/lib/esm/session-manager.d.ts +3 -3
  65. package/lib/esm/session-manager.d.ts.map +1 -1
  66. package/lib/esm/session-manager.js +8 -14
  67. package/lib/esm/session-manager.js.map +1 -1
  68. package/lib/esm/storage/cookie.d.ts +2 -2
  69. package/lib/esm/storage/cookie.d.ts.map +1 -1
  70. package/lib/esm/storage/cookie.js +16 -11
  71. package/lib/esm/storage/cookie.js.map +1 -1
  72. package/lib/esm/storage/local-storage.d.ts +1 -0
  73. package/lib/esm/storage/local-storage.d.ts.map +1 -1
  74. package/lib/esm/storage/local-storage.js +4 -1
  75. package/lib/esm/storage/local-storage.js.map +1 -1
  76. package/lib/esm/storage/memory.d.ts +1 -0
  77. package/lib/esm/storage/memory.d.ts.map +1 -1
  78. package/lib/esm/storage/memory.js +4 -0
  79. package/lib/esm/storage/memory.js.map +1 -1
  80. package/lib/esm/storage/utm-cookie.js +1 -1
  81. package/lib/esm/storage/utm-cookie.js.map +1 -1
  82. package/lib/esm/utils/snippet-helper.d.ts +1 -0
  83. package/lib/esm/utils/snippet-helper.d.ts.map +1 -1
  84. package/lib/esm/utils/snippet-helper.js +1 -0
  85. package/lib/esm/utils/snippet-helper.js.map +1 -1
  86. package/lib/esm/version.d.ts +1 -1
  87. package/lib/esm/version.js +1 -1
  88. package/lib/esm/version.js.map +1 -1
  89. package/lib/scripts/amplitude-min.js +1 -1
  90. package/lib/scripts/amplitude-min.js.gz +0 -0
  91. package/lib/scripts/amplitude-min.umd.js +1 -1
  92. package/lib/scripts/amplitude-min.umd.js.gz +0 -0
  93. package/lib/scripts/amplitude-snippet-instructions.html +1 -1
  94. package/lib/scripts/amplitude-snippet-min.js +1 -1
  95. package/package.json +10 -6
@@ -1,5 +1,5 @@
1
1
  <script type="text/javascript">
2
- !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-TeoEVjqxsQrwhskzwWGK6epJC7EkYjvl7k4gmwunKlRBkUK9nT01H4FL9z4VPMSm",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.3.1-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function m(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}m(r),e.amplitude=r}}(window,document)}();
2
+ !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-cTyMPwluBEHeat1GN+1GyBa6Iy+7pBUktRKWt7PHWlXs/7XucraxWtXA4s/tysw3",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.4.0-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function f(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}f(r),e.amplitude=r}}(window,document)}();
3
3
 
4
4
  amplitude.init("YOUR_API_KEY_HERE");
5
5
  </script>
@@ -1 +1 @@
1
- !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-TeoEVjqxsQrwhskzwWGK6epJC7EkYjvl7k4gmwunKlRBkUK9nT01H4FL9z4VPMSm",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.3.1-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function m(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}m(r),e.amplitude=r}}(window,document)}();
1
+ !function(){"use strict";!function(e,t){var r=e.amplitude||{_q:[]};if(r.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{r.invoked=!0;var n=t.createElement("script");n.type="text/javascript",n.integrity="sha384-cTyMPwluBEHeat1GN+1GyBa6Iy+7pBUktRKWt7PHWlXs/7XucraxWtXA4s/tysw3",n.crossOrigin="anonymous",n.async=!0,n.src="https://cdn.amplitude.com/libs/analytics-browser-0.4.0-min.js.gz",n.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var s=t.getElementsByTagName("script")[0];function v(e,t){e.prototype[t]=function(){return this._q.push({name:t,args:Array.prototype.slice.call(arguments,0)}),this}}s.parentNode.insertBefore(n,s);for(var o=function(){return this._q=[],this},i=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove","getUserProperties"],a=0;a<i.length;a++)v(o,i[a]);r.Identify=o;for(var u=function(){return this._q=[],this},c=["getEventProperties","setProductId","setQuantity","setPrice","setRevenue","setRevenueType","setEventProperties"],p=0;p<c.length;p++)v(u,c[p]);r.Revenue=u;var l=["getDeviceId","setDeviceId","getSessionId","setSessionId","getUserId","setUserId","setOptOut","setTransport"],d=["init","add","remove","track","logEvent","identify","groupIdentify","setGroup","revenue"];function f(e){function t(t,r){e[t]=function(){var n={promise:new Promise((r=>{e._q.push({name:t,args:Array.prototype.slice.call(arguments,0),resolve:r})}))};if(r)return n}}for(var r=0;r<l.length;r++)t(l[r],!1);for(var n=0;n<d.length;n++)t(d[n],!0)}f(r),e.amplitude=r}}(window,document)}();
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-browser",
3
- "version": "0.3.1",
4
- "description": "",
3
+ "version": "0.4.0",
4
+ "description": "Official Amplitude SDK for Web",
5
+ "keywords": [
6
+ "analytics",
7
+ "amplitude"
8
+ ],
5
9
  "author": "Amplitude Inc",
6
10
  "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
7
11
  "license": "MIT",
@@ -29,15 +33,15 @@
29
33
  "publish": "node scripts/publish/upload-to-s3.js",
30
34
  "test": "jest",
31
35
  "typecheck": "tsc -p ./tsconfig.json",
32
- "version": "yarn build",
36
+ "version": "GENERATE_SNIPPET=true yarn build",
33
37
  "vesion-file": "node -p \"'export const VERSION = \\'' + require('./package.json').version + '\\';'\" > src/version.ts"
34
38
  },
35
39
  "bugs": {
36
40
  "url": "https://github.com/amplitude/Amplitude-TypeScript/issues"
37
41
  },
38
42
  "dependencies": {
39
- "@amplitude/analytics-core": "^0.2.4",
40
- "@amplitude/analytics-types": "^0.1.3",
43
+ "@amplitude/analytics-core": "^0.3.0",
44
+ "@amplitude/analytics-types": "^0.2.0",
41
45
  "@amplitude/ua-parser-js": "^0.7.26",
42
46
  "tslib": "^2.3.1"
43
47
  },
@@ -56,5 +60,5 @@
56
60
  "files": [
57
61
  "lib"
58
62
  ],
59
- "gitHead": "58392895e0f09cd602676f7f25504d54b80a44d0"
63
+ "gitHead": "3899a210e9848fcf66a4cd2b353ea2c0c6dd45dc"
60
64
  }