@ht-sdks/events-sdk-js-browser 1.0.4
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.MD +45 -0
- package/README.md +227 -0
- package/dist/cjs/browser/browser-umd.js +21 -0
- package/dist/cjs/browser/browser-umd.js.map +1 -0
- package/dist/cjs/browser/index.js +351 -0
- package/dist/cjs/browser/index.js.map +1 -0
- package/dist/cjs/browser/standalone-analytics.js +62 -0
- package/dist/cjs/browser/standalone-analytics.js.map +1 -0
- package/dist/cjs/browser/standalone-interface.js +3 -0
- package/dist/cjs/browser/standalone-interface.js.map +1 -0
- package/dist/cjs/browser/standalone.js +95 -0
- package/dist/cjs/browser/standalone.js.map +1 -0
- package/dist/cjs/core/analytics/index.js +589 -0
- package/dist/cjs/core/analytics/index.js.map +1 -0
- package/dist/cjs/core/analytics/interfaces.js +3 -0
- package/dist/cjs/core/analytics/interfaces.js.map +1 -0
- package/dist/cjs/core/arguments-resolver/index.js +134 -0
- package/dist/cjs/core/arguments-resolver/index.js.map +1 -0
- package/dist/cjs/core/auto-track.js +108 -0
- package/dist/cjs/core/auto-track.js.map +1 -0
- package/dist/cjs/core/buffer/index.js +303 -0
- package/dist/cjs/core/buffer/index.js.map +1 -0
- package/dist/cjs/core/callback/index.js +7 -0
- package/dist/cjs/core/callback/index.js.map +1 -0
- package/dist/cjs/core/connection/index.js +16 -0
- package/dist/cjs/core/connection/index.js.map +1 -0
- package/dist/cjs/core/constants/index.js +5 -0
- package/dist/cjs/core/constants/index.js.map +1 -0
- package/dist/cjs/core/context/index.js +19 -0
- package/dist/cjs/core/context/index.js.map +1 -0
- package/dist/cjs/core/environment/index.js +12 -0
- package/dist/cjs/core/environment/index.js.map +1 -0
- package/dist/cjs/core/events/index.js +138 -0
- package/dist/cjs/core/events/index.js.map +1 -0
- package/dist/cjs/core/events/interfaces.js +3 -0
- package/dist/cjs/core/events/interfaces.js.map +1 -0
- package/dist/cjs/core/inspector/index.js +14 -0
- package/dist/cjs/core/inspector/index.js.map +1 -0
- package/dist/cjs/core/page/add-page-context.js +25 -0
- package/dist/cjs/core/page/add-page-context.js.map +1 -0
- package/dist/cjs/core/page/get-page-context.js +92 -0
- package/dist/cjs/core/page/get-page-context.js.map +1 -0
- package/dist/cjs/core/page/index.js +6 -0
- package/dist/cjs/core/page/index.js.map +1 -0
- package/dist/cjs/core/plugin/index.js +3 -0
- package/dist/cjs/core/plugin/index.js.map +1 -0
- package/dist/cjs/core/query-string/gracefulDecodeURIComponent.js +20 -0
- package/dist/cjs/core/query-string/gracefulDecodeURIComponent.js.map +1 -0
- package/dist/cjs/core/query-string/index.js +48 -0
- package/dist/cjs/core/query-string/index.js.map +1 -0
- package/dist/cjs/core/query-string/pickPrefix.js +20 -0
- package/dist/cjs/core/query-string/pickPrefix.js.map +1 -0
- package/dist/cjs/core/queue/event-queue.js +27 -0
- package/dist/cjs/core/queue/event-queue.js.map +1 -0
- package/dist/cjs/core/session/index.js +71 -0
- package/dist/cjs/core/session/index.js.map +1 -0
- package/dist/cjs/core/stats/index.js +23 -0
- package/dist/cjs/core/stats/index.js.map +1 -0
- package/dist/cjs/core/stats/remote-metrics.js +111 -0
- package/dist/cjs/core/stats/remote-metrics.js.map +1 -0
- package/dist/cjs/core/storage/cookieStorage.js +72 -0
- package/dist/cjs/core/storage/cookieStorage.js.map +1 -0
- package/dist/cjs/core/storage/index.js +64 -0
- package/dist/cjs/core/storage/index.js.map +1 -0
- package/dist/cjs/core/storage/localStorage.js +51 -0
- package/dist/cjs/core/storage/localStorage.js.map +1 -0
- package/dist/cjs/core/storage/memoryStorage.js +24 -0
- package/dist/cjs/core/storage/memoryStorage.js.map +1 -0
- package/dist/cjs/core/storage/settings.js +16 -0
- package/dist/cjs/core/storage/settings.js.map +1 -0
- package/dist/cjs/core/storage/types.js +9 -0
- package/dist/cjs/core/storage/types.js.map +1 -0
- package/dist/cjs/core/storage/universalStorage.js +66 -0
- package/dist/cjs/core/storage/universalStorage.js.map +1 -0
- package/dist/cjs/core/user/index.js +273 -0
- package/dist/cjs/core/user/index.js.map +1 -0
- package/dist/cjs/core/user/migrate.js +114 -0
- package/dist/cjs/core/user/migrate.js.map +1 -0
- package/dist/cjs/core/user/tld.js +64 -0
- package/dist/cjs/core/user/tld.js.map +1 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/aes.js +248 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/aes.js.map +1 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/cipher-core.js +841 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/cipher-core.js.map +1 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/core.js +747 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/core.js.map +1 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/enc-base64.js +102 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/enc-base64.js.map +1 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/evpkdf.js +105 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/evpkdf.js.map +1 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/md5.js +217 -0
- package/dist/cjs/core/user/vendor/crypto-es/lib/md5.js.map +1 -0
- package/dist/cjs/generated/version.js +6 -0
- package/dist/cjs/generated/version.js.map +1 -0
- package/dist/cjs/index.js +16 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/bind-all.js +17 -0
- package/dist/cjs/lib/bind-all.js.map +1 -0
- package/dist/cjs/lib/browser-polyfill.js +22 -0
- package/dist/cjs/lib/browser-polyfill.js.map +1 -0
- package/dist/cjs/lib/client-hints/index.js +21 -0
- package/dist/cjs/lib/client-hints/index.js.map +1 -0
- package/dist/cjs/lib/client-hints/interfaces.js +3 -0
- package/dist/cjs/lib/client-hints/interfaces.js.map +1 -0
- package/dist/cjs/lib/create-deferred.js +21 -0
- package/dist/cjs/lib/create-deferred.js.map +1 -0
- package/dist/cjs/lib/csp-detection.js +8 -0
- package/dist/cjs/lib/csp-detection.js.map +1 -0
- package/dist/cjs/lib/embedded-write-key.js +22 -0
- package/dist/cjs/lib/embedded-write-key.js.map +1 -0
- package/dist/cjs/lib/fetch.js +19 -0
- package/dist/cjs/lib/fetch.js.map +1 -0
- package/dist/cjs/lib/get-global.js +21 -0
- package/dist/cjs/lib/get-global.js.map +1 -0
- package/dist/cjs/lib/get-process-env.js +15 -0
- package/dist/cjs/lib/get-process-env.js.map +1 -0
- package/dist/cjs/lib/global-analytics-helper.js +34 -0
- package/dist/cjs/lib/global-analytics-helper.js.map +1 -0
- package/dist/cjs/lib/group-by.js +28 -0
- package/dist/cjs/lib/group-by.js.map +1 -0
- package/dist/cjs/lib/is-plan-event-enabled.js +20 -0
- package/dist/cjs/lib/is-plan-event-enabled.js.map +1 -0
- package/dist/cjs/lib/is-thenable.js +15 -0
- package/dist/cjs/lib/is-thenable.js.map +1 -0
- package/dist/cjs/lib/load-script.js +56 -0
- package/dist/cjs/lib/load-script.js.map +1 -0
- package/dist/cjs/lib/merged-options.js +31 -0
- package/dist/cjs/lib/merged-options.js.map +1 -0
- package/dist/cjs/lib/on-page-change.js +35 -0
- package/dist/cjs/lib/on-page-change.js.map +1 -0
- package/dist/cjs/lib/p-while.js +25 -0
- package/dist/cjs/lib/p-while.js.map +1 -0
- package/dist/cjs/lib/parse-cdn.js +55 -0
- package/dist/cjs/lib/parse-cdn.js.map +1 -0
- package/dist/cjs/lib/pick.js +19 -0
- package/dist/cjs/lib/pick.js.map +1 -0
- package/dist/cjs/lib/priority-queue/backoff.js +10 -0
- package/dist/cjs/lib/priority-queue/backoff.js.map +1 -0
- package/dist/cjs/lib/priority-queue/index.js +7 -0
- package/dist/cjs/lib/priority-queue/index.js.map +1 -0
- package/dist/cjs/lib/priority-queue/persisted.js +108 -0
- package/dist/cjs/lib/priority-queue/persisted.js.map +1 -0
- package/dist/cjs/lib/sleep.js +10 -0
- package/dist/cjs/lib/sleep.js.map +1 -0
- package/dist/cjs/lib/to-facade.js +32 -0
- package/dist/cjs/lib/to-facade.js.map +1 -0
- package/dist/cjs/lib/version-type.js +14 -0
- package/dist/cjs/lib/version-type.js.map +1 -0
- package/dist/cjs/node/index.js +43 -0
- package/dist/cjs/node/index.js.map +1 -0
- package/dist/cjs/node/node.browser.js +13 -0
- package/dist/cjs/node/node.browser.js.map +1 -0
- package/dist/cjs/plugins/ajs-destination/index.js +345 -0
- package/dist/cjs/plugins/ajs-destination/index.js.map +1 -0
- package/dist/cjs/plugins/ajs-destination/loader.js +110 -0
- package/dist/cjs/plugins/ajs-destination/loader.js.map +1 -0
- package/dist/cjs/plugins/ajs-destination/types.js +3 -0
- package/dist/cjs/plugins/ajs-destination/types.js.map +1 -0
- package/dist/cjs/plugins/ajs-destination/utils.js +23 -0
- package/dist/cjs/plugins/ajs-destination/utils.js.map +1 -0
- package/dist/cjs/plugins/analytics-node/index.js +65 -0
- package/dist/cjs/plugins/analytics-node/index.js.map +1 -0
- package/dist/cjs/plugins/env-enrichment/index.js +181 -0
- package/dist/cjs/plugins/env-enrichment/index.js.map +1 -0
- package/dist/cjs/plugins/hightouchio/batched-dispatcher.js +113 -0
- package/dist/cjs/plugins/hightouchio/batched-dispatcher.js.map +1 -0
- package/dist/cjs/plugins/hightouchio/fetch-dispatcher.js +21 -0
- package/dist/cjs/plugins/hightouchio/fetch-dispatcher.js.map +1 -0
- package/dist/cjs/plugins/hightouchio/index.js +100 -0
- package/dist/cjs/plugins/hightouchio/index.js.map +1 -0
- package/dist/cjs/plugins/hightouchio/normalize.js +54 -0
- package/dist/cjs/plugins/hightouchio/normalize.js.map +1 -0
- package/dist/cjs/plugins/hightouchio/schedule-flush.js +76 -0
- package/dist/cjs/plugins/hightouchio/schedule-flush.js.map +1 -0
- package/dist/cjs/plugins/legacy-video-plugins/index.js +25 -0
- package/dist/cjs/plugins/legacy-video-plugins/index.js.map +1 -0
- package/dist/cjs/plugins/middleware/index.js +124 -0
- package/dist/cjs/plugins/middleware/index.js.map +1 -0
- package/dist/cjs/plugins/remote-loader/index.js +236 -0
- package/dist/cjs/plugins/remote-loader/index.js.map +1 -0
- package/dist/cjs/plugins/remote-middleware/index.js +70 -0
- package/dist/cjs/plugins/remote-middleware/index.js.map +1 -0
- package/dist/cjs/plugins/routing-middleware/index.js +26 -0
- package/dist/cjs/plugins/routing-middleware/index.js.map +1 -0
- package/dist/cjs/plugins/schema-filter/index.js +67 -0
- package/dist/cjs/plugins/schema-filter/index.js.map +1 -0
- package/dist/cjs/plugins/validation/index.js +33 -0
- package/dist/cjs/plugins/validation/index.js.map +1 -0
- package/dist/pkg/browser/browser-umd.js +18 -0
- package/dist/pkg/browser/browser-umd.js.map +1 -0
- package/dist/pkg/browser/index.js +347 -0
- package/dist/pkg/browser/index.js.map +1 -0
- package/dist/pkg/browser/standalone-analytics.js +58 -0
- package/dist/pkg/browser/standalone-analytics.js.map +1 -0
- package/dist/pkg/browser/standalone-interface.js +2 -0
- package/dist/pkg/browser/standalone-interface.js.map +1 -0
- package/dist/pkg/browser/standalone.js +93 -0
- package/dist/pkg/browser/standalone.js.map +1 -0
- package/dist/pkg/core/analytics/index.js +586 -0
- package/dist/pkg/core/analytics/index.js.map +1 -0
- package/dist/pkg/core/analytics/interfaces.js +2 -0
- package/dist/pkg/core/analytics/interfaces.js.map +1 -0
- package/dist/pkg/core/arguments-resolver/index.js +127 -0
- package/dist/pkg/core/arguments-resolver/index.js.map +1 -0
- package/dist/pkg/core/auto-track.js +103 -0
- package/dist/pkg/core/auto-track.js.map +1 -0
- package/dist/pkg/core/buffer/index.js +295 -0
- package/dist/pkg/core/buffer/index.js.map +1 -0
- package/dist/pkg/core/callback/index.js +2 -0
- package/dist/pkg/core/callback/index.js.map +1 -0
- package/dist/pkg/core/connection/index.js +11 -0
- package/dist/pkg/core/connection/index.js.map +1 -0
- package/dist/pkg/core/constants/index.js +2 -0
- package/dist/pkg/core/constants/index.js.map +1 -0
- package/dist/pkg/core/context/index.js +16 -0
- package/dist/pkg/core/context/index.js.map +1 -0
- package/dist/pkg/core/environment/index.js +7 -0
- package/dist/pkg/core/environment/index.js.map +1 -0
- package/dist/pkg/core/events/index.js +135 -0
- package/dist/pkg/core/events/index.js.map +1 -0
- package/dist/pkg/core/events/interfaces.js +2 -0
- package/dist/pkg/core/events/interfaces.js.map +1 -0
- package/dist/pkg/core/inspector/index.js +10 -0
- package/dist/pkg/core/inspector/index.js.map +1 -0
- package/dist/pkg/core/page/add-page-context.js +21 -0
- package/dist/pkg/core/page/add-page-context.js.map +1 -0
- package/dist/pkg/core/page/get-page-context.js +84 -0
- package/dist/pkg/core/page/get-page-context.js.map +1 -0
- package/dist/pkg/core/page/index.js +3 -0
- package/dist/pkg/core/page/index.js.map +1 -0
- package/dist/pkg/core/plugin/index.js +2 -0
- package/dist/pkg/core/plugin/index.js.map +1 -0
- package/dist/pkg/core/query-string/gracefulDecodeURIComponent.js +16 -0
- package/dist/pkg/core/query-string/gracefulDecodeURIComponent.js.map +1 -0
- package/dist/pkg/core/query-string/index.js +44 -0
- package/dist/pkg/core/query-string/index.js.map +1 -0
- package/dist/pkg/core/query-string/pickPrefix.js +16 -0
- package/dist/pkg/core/query-string/pickPrefix.js.map +1 -0
- package/dist/pkg/core/queue/event-queue.js +24 -0
- package/dist/pkg/core/queue/event-queue.js.map +1 -0
- package/dist/pkg/core/session/index.js +63 -0
- package/dist/pkg/core/session/index.js.map +1 -0
- package/dist/pkg/core/stats/index.js +20 -0
- package/dist/pkg/core/stats/index.js.map +1 -0
- package/dist/pkg/core/stats/remote-metrics.js +108 -0
- package/dist/pkg/core/stats/remote-metrics.js.map +1 -0
- package/dist/pkg/core/storage/cookieStorage.js +69 -0
- package/dist/pkg/core/storage/cookieStorage.js.map +1 -0
- package/dist/pkg/core/storage/index.js +58 -0
- package/dist/pkg/core/storage/index.js.map +1 -0
- package/dist/pkg/core/storage/localStorage.js +48 -0
- package/dist/pkg/core/storage/localStorage.js.map +1 -0
- package/dist/pkg/core/storage/memoryStorage.js +21 -0
- package/dist/pkg/core/storage/memoryStorage.js.map +1 -0
- package/dist/pkg/core/storage/settings.js +11 -0
- package/dist/pkg/core/storage/settings.js.map +1 -0
- package/dist/pkg/core/storage/types.js +6 -0
- package/dist/pkg/core/storage/types.js.map +1 -0
- package/dist/pkg/core/storage/universalStorage.js +63 -0
- package/dist/pkg/core/storage/universalStorage.js.map +1 -0
- package/dist/pkg/core/user/index.js +270 -0
- package/dist/pkg/core/user/index.js.map +1 -0
- package/dist/pkg/core/user/migrate.js +109 -0
- package/dist/pkg/core/user/migrate.js.map +1 -0
- package/dist/pkg/core/user/tld.js +59 -0
- package/dist/pkg/core/user/tld.js.map +1 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/aes.js +245 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/aes.js.map +1 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/cipher-core.js +838 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/cipher-core.js.map +1 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/core.js +744 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/core.js.map +1 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/enc-base64.js +98 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/enc-base64.js.map +1 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/evpkdf.js +101 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/evpkdf.js.map +1 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/md5.js +214 -0
- package/dist/pkg/core/user/vendor/crypto-es/lib/md5.js.map +1 -0
- package/dist/pkg/generated/version.js +3 -0
- package/dist/pkg/generated/version.js.map +1 -0
- package/dist/pkg/index.js +10 -0
- package/dist/pkg/index.js.map +1 -0
- package/dist/pkg/lib/bind-all.js +14 -0
- package/dist/pkg/lib/bind-all.js.map +1 -0
- package/dist/pkg/lib/browser-polyfill.js +18 -0
- package/dist/pkg/lib/browser-polyfill.js.map +1 -0
- package/dist/pkg/lib/client-hints/index.js +17 -0
- package/dist/pkg/lib/client-hints/index.js.map +1 -0
- package/dist/pkg/lib/client-hints/interfaces.js +2 -0
- package/dist/pkg/lib/client-hints/interfaces.js.map +1 -0
- package/dist/pkg/lib/create-deferred.js +17 -0
- package/dist/pkg/lib/create-deferred.js.map +1 -0
- package/dist/pkg/lib/csp-detection.js +4 -0
- package/dist/pkg/lib/csp-detection.js.map +1 -0
- package/dist/pkg/lib/embedded-write-key.js +18 -0
- package/dist/pkg/lib/embedded-write-key.js.map +1 -0
- package/dist/pkg/lib/fetch.js +14 -0
- package/dist/pkg/lib/fetch.js.map +1 -0
- package/dist/pkg/lib/get-global.js +17 -0
- package/dist/pkg/lib/get-global.js.map +1 -0
- package/dist/pkg/lib/get-process-env.js +11 -0
- package/dist/pkg/lib/get-process-env.js.map +1 -0
- package/dist/pkg/lib/global-analytics-helper.js +28 -0
- package/dist/pkg/lib/global-analytics-helper.js.map +1 -0
- package/dist/pkg/lib/group-by.js +24 -0
- package/dist/pkg/lib/group-by.js.map +1 -0
- package/dist/pkg/lib/is-plan-event-enabled.js +16 -0
- package/dist/pkg/lib/is-plan-event-enabled.js.map +1 -0
- package/dist/pkg/lib/is-thenable.js +11 -0
- package/dist/pkg/lib/is-thenable.js.map +1 -0
- package/dist/pkg/lib/load-script.js +51 -0
- package/dist/pkg/lib/load-script.js.map +1 -0
- package/dist/pkg/lib/merged-options.js +27 -0
- package/dist/pkg/lib/merged-options.js.map +1 -0
- package/dist/pkg/lib/on-page-change.js +31 -0
- package/dist/pkg/lib/on-page-change.js.map +1 -0
- package/dist/pkg/lib/p-while.js +21 -0
- package/dist/pkg/lib/p-while.js.map +1 -0
- package/dist/pkg/lib/parse-cdn.js +49 -0
- package/dist/pkg/lib/parse-cdn.js.map +1 -0
- package/dist/pkg/lib/pick.js +15 -0
- package/dist/pkg/lib/pick.js.map +1 -0
- package/dist/pkg/lib/priority-queue/backoff.js +6 -0
- package/dist/pkg/lib/priority-queue/backoff.js.map +1 -0
- package/dist/pkg/lib/priority-queue/index.js +3 -0
- package/dist/pkg/lib/priority-queue/index.js.map +1 -0
- package/dist/pkg/lib/priority-queue/persisted.js +105 -0
- package/dist/pkg/lib/priority-queue/persisted.js.map +1 -0
- package/dist/pkg/lib/sleep.js +6 -0
- package/dist/pkg/lib/sleep.js.map +1 -0
- package/dist/pkg/lib/to-facade.js +28 -0
- package/dist/pkg/lib/to-facade.js.map +1 -0
- package/dist/pkg/lib/version-type.js +9 -0
- package/dist/pkg/lib/version-type.js.map +1 -0
- package/dist/pkg/node/index.js +40 -0
- package/dist/pkg/node/index.js.map +1 -0
- package/dist/pkg/node/node.browser.js +10 -0
- package/dist/pkg/node/node.browser.js.map +1 -0
- package/dist/pkg/plugins/ajs-destination/index.js +341 -0
- package/dist/pkg/plugins/ajs-destination/index.js.map +1 -0
- package/dist/pkg/plugins/ajs-destination/loader.js +102 -0
- package/dist/pkg/plugins/ajs-destination/loader.js.map +1 -0
- package/dist/pkg/plugins/ajs-destination/types.js +2 -0
- package/dist/pkg/plugins/ajs-destination/types.js.map +1 -0
- package/dist/pkg/plugins/ajs-destination/utils.js +18 -0
- package/dist/pkg/plugins/ajs-destination/utils.js.map +1 -0
- package/dist/pkg/plugins/analytics-node/index.js +60 -0
- package/dist/pkg/plugins/analytics-node/index.js.map +1 -0
- package/dist/pkg/plugins/env-enrichment/index.js +176 -0
- package/dist/pkg/plugins/env-enrichment/index.js.map +1 -0
- package/dist/pkg/plugins/hightouchio/batched-dispatcher.js +110 -0
- package/dist/pkg/plugins/hightouchio/batched-dispatcher.js.map +1 -0
- package/dist/pkg/plugins/hightouchio/fetch-dispatcher.js +18 -0
- package/dist/pkg/plugins/hightouchio/fetch-dispatcher.js.map +1 -0
- package/dist/pkg/plugins/hightouchio/index.js +96 -0
- package/dist/pkg/plugins/hightouchio/index.js.map +1 -0
- package/dist/pkg/plugins/hightouchio/normalize.js +50 -0
- package/dist/pkg/plugins/hightouchio/normalize.js.map +1 -0
- package/dist/pkg/plugins/hightouchio/schedule-flush.js +72 -0
- package/dist/pkg/plugins/hightouchio/schedule-flush.js.map +1 -0
- package/dist/pkg/plugins/legacy-video-plugins/index.js +25 -0
- package/dist/pkg/plugins/legacy-video-plugins/index.js.map +1 -0
- package/dist/pkg/plugins/middleware/index.js +119 -0
- package/dist/pkg/plugins/middleware/index.js.map +1 -0
- package/dist/pkg/plugins/remote-loader/index.js +232 -0
- package/dist/pkg/plugins/remote-loader/index.js.map +1 -0
- package/dist/pkg/plugins/remote-middleware/index.js +66 -0
- package/dist/pkg/plugins/remote-middleware/index.js.map +1 -0
- package/dist/pkg/plugins/routing-middleware/index.js +21 -0
- package/dist/pkg/plugins/routing-middleware/index.js.map +1 -0
- package/dist/pkg/plugins/schema-filter/index.js +63 -0
- package/dist/pkg/plugins/schema-filter/index.js.map +1 -0
- package/dist/pkg/plugins/validation/index.js +30 -0
- package/dist/pkg/plugins/validation/index.js.map +1 -0
- package/dist/types/browser/browser-umd.d.ts +2 -0
- package/dist/types/browser/browser-umd.d.ts.map +1 -0
- package/dist/types/browser/index.d.ts +109 -0
- package/dist/types/browser/index.d.ts.map +1 -0
- package/dist/types/browser/standalone-analytics.d.ts +2 -0
- package/dist/types/browser/standalone-analytics.d.ts.map +1 -0
- package/dist/types/browser/standalone-interface.d.ts +10 -0
- package/dist/types/browser/standalone-interface.d.ts.map +1 -0
- package/dist/types/browser/standalone.d.ts +2 -0
- package/dist/types/browser/standalone.d.ts.map +1 -0
- package/dist/types/core/analytics/index.d.ts +149 -0
- package/dist/types/core/analytics/index.d.ts.map +1 -0
- package/dist/types/core/analytics/interfaces.d.ts +77 -0
- package/dist/types/core/analytics/interfaces.d.ts.map +1 -0
- package/dist/types/core/arguments-resolver/index.d.ts +34 -0
- package/dist/types/core/arguments-resolver/index.d.ts.map +1 -0
- package/dist/types/core/auto-track.d.ts +10 -0
- package/dist/types/core/auto-track.d.ts.map +1 -0
- package/dist/types/core/buffer/index.d.ts +102 -0
- package/dist/types/core/buffer/index.d.ts.map +1 -0
- package/dist/types/core/callback/index.d.ts +2 -0
- package/dist/types/core/callback/index.d.ts.map +1 -0
- package/dist/types/core/connection/index.d.ts +3 -0
- package/dist/types/core/connection/index.d.ts.map +1 -0
- package/dist/types/core/constants/index.d.ts +2 -0
- package/dist/types/core/constants/index.d.ts.map +1 -0
- package/dist/types/core/context/index.d.ts +9 -0
- package/dist/types/core/context/index.d.ts.map +1 -0
- package/dist/types/core/environment/index.d.ts +3 -0
- package/dist/types/core/environment/index.d.ts.map +1 -0
- package/dist/types/core/events/index.d.ts +22 -0
- package/dist/types/core/events/index.d.ts.map +1 -0
- package/dist/types/core/events/interfaces.d.ts +9 -0
- package/dist/types/core/events/interfaces.d.ts.map +1 -0
- package/dist/types/core/inspector/index.d.ts +3 -0
- package/dist/types/core/inspector/index.d.ts.map +1 -0
- package/dist/types/core/page/add-page-context.d.ts +9 -0
- package/dist/types/core/page/add-page-context.d.ts.map +1 -0
- package/dist/types/core/page/get-page-context.d.ts +45 -0
- package/dist/types/core/page/get-page-context.d.ts.map +1 -0
- package/dist/types/core/page/index.d.ts +3 -0
- package/dist/types/core/page/index.d.ts.map +1 -0
- package/dist/types/core/plugin/index.d.ts +11 -0
- package/dist/types/core/plugin/index.d.ts.map +1 -0
- package/dist/types/core/query-string/gracefulDecodeURIComponent.d.ts +9 -0
- package/dist/types/core/query-string/gracefulDecodeURIComponent.d.ts.map +1 -0
- package/dist/types/core/query-string/index.d.ts +7 -0
- package/dist/types/core/query-string/index.d.ts.map +1 -0
- package/dist/types/core/query-string/pickPrefix.d.ts +9 -0
- package/dist/types/core/query-string/pickPrefix.d.ts.map +1 -0
- package/dist/types/core/queue/event-queue.d.ts +10 -0
- package/dist/types/core/queue/event-queue.d.ts.map +1 -0
- package/dist/types/core/session/index.d.ts +32 -0
- package/dist/types/core/session/index.d.ts.map +1 -0
- package/dist/types/core/stats/index.d.ts +7 -0
- package/dist/types/core/stats/index.d.ts.map +1 -0
- package/dist/types/core/stats/remote-metrics.d.ts +32 -0
- package/dist/types/core/stats/remote-metrics.d.ts.map +1 -0
- package/dist/types/core/storage/cookieStorage.d.ts +21 -0
- package/dist/types/core/storage/cookieStorage.d.ts.map +1 -0
- package/dist/types/core/storage/index.d.ts +22 -0
- package/dist/types/core/storage/index.d.ts.map +1 -0
- package/dist/types/core/storage/localStorage.d.ts +11 -0
- package/dist/types/core/storage/localStorage.d.ts.map +1 -0
- package/dist/types/core/storage/memoryStorage.d.ts +11 -0
- package/dist/types/core/storage/memoryStorage.d.ts.map +1 -0
- package/dist/types/core/storage/settings.d.ts +8 -0
- package/dist/types/core/storage/settings.d.ts.map +1 -0
- package/dist/types/core/storage/types.d.ts +43 -0
- package/dist/types/core/storage/types.d.ts.map +1 -0
- package/dist/types/core/storage/universalStorage.d.ts +13 -0
- package/dist/types/core/storage/universalStorage.d.ts.map +1 -0
- package/dist/types/core/user/index.d.ts +81 -0
- package/dist/types/core/user/index.d.ts.map +1 -0
- package/dist/types/core/user/migrate.d.ts +11 -0
- package/dist/types/core/user/migrate.d.ts.map +1 -0
- package/dist/types/core/user/tld.d.ts +2 -0
- package/dist/types/core/user/tld.d.ts.map +1 -0
- package/dist/types/core/user/vendor/crypto-es/lib/aes.d.ts +23 -0
- package/dist/types/core/user/vendor/crypto-es/lib/aes.d.ts.map +1 -0
- package/dist/types/core/user/vendor/crypto-es/lib/cipher-core.d.ts +436 -0
- package/dist/types/core/user/vendor/crypto-es/lib/cipher-core.d.ts.map +1 -0
- package/dist/types/core/user/vendor/crypto-es/lib/core.d.ts +432 -0
- package/dist/types/core/user/vendor/crypto-es/lib/core.d.ts.map +1 -0
- package/dist/types/core/user/vendor/crypto-es/lib/enc-base64.d.ts +36 -0
- package/dist/types/core/user/vendor/crypto-es/lib/enc-base64.d.ts.map +1 -0
- package/dist/types/core/user/vendor/crypto-es/lib/evpkdf.d.ts +51 -0
- package/dist/types/core/user/vendor/crypto-es/lib/evpkdf.d.ts.map +1 -0
- package/dist/types/core/user/vendor/crypto-es/lib/md5.d.ts +41 -0
- package/dist/types/core/user/vendor/crypto-es/lib/md5.d.ts.map +1 -0
- package/dist/types/generated/version.d.ts +2 -0
- package/dist/types/generated/version.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/bind-all.d.ts +4 -0
- package/dist/types/lib/bind-all.d.ts.map +1 -0
- package/dist/types/lib/browser-polyfill.d.ts +2 -0
- package/dist/types/lib/browser-polyfill.d.ts.map +1 -0
- package/dist/types/lib/client-hints/index.d.ts +3 -0
- package/dist/types/lib/client-hints/index.d.ts.map +1 -0
- package/dist/types/lib/client-hints/interfaces.d.ts +28 -0
- package/dist/types/lib/client-hints/interfaces.d.ts.map +1 -0
- package/dist/types/lib/create-deferred.d.ts +9 -0
- package/dist/types/lib/create-deferred.d.ts.map +1 -0
- package/dist/types/lib/csp-detection.d.ts +6 -0
- package/dist/types/lib/csp-detection.d.ts.map +1 -0
- package/dist/types/lib/embedded-write-key.d.ts +7 -0
- package/dist/types/lib/embedded-write-key.d.ts.map +1 -0
- package/dist/types/lib/fetch.d.ts +5 -0
- package/dist/types/lib/fetch.d.ts.map +1 -0
- package/dist/types/lib/get-global.d.ts +2 -0
- package/dist/types/lib/get-global.d.ts.map +1 -0
- package/dist/types/lib/get-process-env.d.ts +8 -0
- package/dist/types/lib/get-process-env.d.ts.map +1 -0
- package/dist/types/lib/global-analytics-helper.d.ts +18 -0
- package/dist/types/lib/global-analytics-helper.d.ts.map +1 -0
- package/dist/types/lib/group-by.d.ts +4 -0
- package/dist/types/lib/group-by.d.ts.map +1 -0
- package/dist/types/lib/is-plan-event-enabled.d.ts +9 -0
- package/dist/types/lib/is-plan-event-enabled.d.ts.map +1 -0
- package/dist/types/lib/is-thenable.d.ts +6 -0
- package/dist/types/lib/is-thenable.d.ts.map +1 -0
- package/dist/types/lib/load-script.d.ts +3 -0
- package/dist/types/lib/load-script.d.ts.map +1 -0
- package/dist/types/lib/merged-options.d.ts +13 -0
- package/dist/types/lib/merged-options.d.ts.map +1 -0
- package/dist/types/lib/on-page-change.d.ts +11 -0
- package/dist/types/lib/on-page-change.d.ts.map +1 -0
- package/dist/types/lib/p-while.d.ts +2 -0
- package/dist/types/lib/p-while.d.ts.map +1 -0
- package/dist/types/lib/parse-cdn.d.ts +4 -0
- package/dist/types/lib/parse-cdn.d.ts.map +1 -0
- package/dist/types/lib/pick.d.ts +3 -0
- package/dist/types/lib/pick.d.ts.map +1 -0
- package/dist/types/lib/priority-queue/backoff.d.ts +13 -0
- package/dist/types/lib/priority-queue/backoff.d.ts.map +1 -0
- package/dist/types/lib/priority-queue/index.d.ts +3 -0
- package/dist/types/lib/priority-queue/index.d.ts.map +1 -0
- package/dist/types/lib/priority-queue/persisted.d.ts +6 -0
- package/dist/types/lib/priority-queue/persisted.d.ts.map +1 -0
- package/dist/types/lib/sleep.d.ts +2 -0
- package/dist/types/lib/sleep.d.ts.map +1 -0
- package/dist/types/lib/to-facade.d.ts +7 -0
- package/dist/types/lib/to-facade.d.ts.map +1 -0
- package/dist/types/lib/version-type.d.ts +5 -0
- package/dist/types/lib/version-type.d.ts.map +1 -0
- package/dist/types/node/index.d.ts +8 -0
- package/dist/types/node/index.d.ts.map +1 -0
- package/dist/types/node/node.browser.d.ts +4 -0
- package/dist/types/node/node.browser.d.ts.map +1 -0
- package/dist/types/plugins/ajs-destination/index.d.ts +42 -0
- package/dist/types/plugins/ajs-destination/index.d.ts.map +1 -0
- package/dist/types/plugins/ajs-destination/loader.d.ts +12 -0
- package/dist/types/plugins/ajs-destination/loader.d.ts.map +1 -0
- package/dist/types/plugins/ajs-destination/types.d.ts +36 -0
- package/dist/types/plugins/ajs-destination/types.d.ts.map +1 -0
- package/dist/types/plugins/ajs-destination/utils.d.ts +5 -0
- package/dist/types/plugins/ajs-destination/utils.d.ts.map +1 -0
- package/dist/types/plugins/analytics-node/index.d.ts +12 -0
- package/dist/types/plugins/analytics-node/index.d.ts.map +1 -0
- package/dist/types/plugins/env-enrichment/index.d.ts +25 -0
- package/dist/types/plugins/env-enrichment/index.d.ts.map +1 -0
- package/dist/types/plugins/hightouchio/batched-dispatcher.d.ts +8 -0
- package/dist/types/plugins/hightouchio/batched-dispatcher.d.ts.map +1 -0
- package/dist/types/plugins/hightouchio/fetch-dispatcher.d.ts +8 -0
- package/dist/types/plugins/hightouchio/fetch-dispatcher.d.ts.map +1 -0
- package/dist/types/plugins/hightouchio/index.d.ts +26 -0
- package/dist/types/plugins/hightouchio/index.d.ts.map +1 -0
- package/dist/types/plugins/hightouchio/normalize.d.ts +6 -0
- package/dist/types/plugins/hightouchio/normalize.d.ts.map +1 -0
- package/dist/types/plugins/hightouchio/schedule-flush.d.ts +5 -0
- package/dist/types/plugins/hightouchio/schedule-flush.d.ts.map +1 -0
- package/dist/types/plugins/legacy-video-plugins/index.d.ts +3 -0
- package/dist/types/plugins/legacy-video-plugins/index.d.ts.map +1 -0
- package/dist/types/plugins/middleware/index.d.ts +18 -0
- package/dist/types/plugins/middleware/index.d.ts.map +1 -0
- package/dist/types/plugins/remote-loader/index.d.ts +47 -0
- package/dist/types/plugins/remote-loader/index.d.ts.map +1 -0
- package/dist/types/plugins/remote-middleware/index.d.ts +5 -0
- package/dist/types/plugins/remote-middleware/index.d.ts.map +1 -0
- package/dist/types/plugins/routing-middleware/index.d.ts +13 -0
- package/dist/types/plugins/routing-middleware/index.d.ts.map +1 -0
- package/dist/types/plugins/schema-filter/index.d.ts +5 -0
- package/dist/types/plugins/schema-filter/index.d.ts.map +1 -0
- package/dist/types/plugins/validation/index.d.ts +3 -0
- package/dist/types/plugins/validation/index.d.ts.map +1 -0
- package/dist/umd/799.bundle.cf7e55682bfd23cde904.js +2 -0
- package/dist/umd/799.bundle.cf7e55682bfd23cde904.js.map +1 -0
- package/dist/umd/870.bundle.6d7307379da86a3bf277.js +2 -0
- package/dist/umd/870.bundle.6d7307379da86a3bf277.js.map +1 -0
- package/dist/umd/ajs-destination.bundle.5a985a542b0de08e3e49.js +2 -0
- package/dist/umd/ajs-destination.bundle.5a985a542b0de08e3e49.js.map +1 -0
- package/dist/umd/auto-track.bundle.08c0e0f63bb92f96f8b5.js +2 -0
- package/dist/umd/auto-track.bundle.08c0e0f63bb92f96f8b5.js.map +1 -0
- package/dist/umd/events.min.js +2 -0
- package/dist/umd/events.min.js.map +1 -0
- package/dist/umd/index.js +2 -0
- package/dist/umd/index.js.map +1 -0
- package/dist/umd/legacyVideos.bundle.6250709892bb05b68333.js +2 -0
- package/dist/umd/legacyVideos.bundle.6250709892bb05b68333.js.map +1 -0
- package/dist/umd/queryString.bundle.e47b8db88c102418c8c2.js +2 -0
- package/dist/umd/queryString.bundle.e47b8db88c102418c8c2.js.map +1 -0
- package/dist/umd/remoteMiddleware.bundle.4da71e934f9fcee73678.js +2 -0
- package/dist/umd/remoteMiddleware.bundle.4da71e934f9fcee73678.js.map +1 -0
- package/dist/umd/schemaFilter.bundle.a17fd62888b293279f4b.js +2 -0
- package/dist/umd/schemaFilter.bundle.a17fd62888b293279f4b.js.map +1 -0
- package/dist/umd/tsub-middleware.bundle.a9604b3195f6189e429b.js +2 -0
- package/dist/umd/tsub-middleware.bundle.a9604b3195f6189e429b.js.map +1 -0
- package/package.json +106 -0
- package/src/browser/browser-umd.ts +19 -0
- package/src/browser/index.ts +486 -0
- package/src/browser/standalone-analytics.ts +62 -0
- package/src/browser/standalone-interface.ts +11 -0
- package/src/browser/standalone.ts +92 -0
- package/src/core/analytics/index.ts +672 -0
- package/src/core/analytics/interfaces.ts +100 -0
- package/src/core/arguments-resolver/index.ts +200 -0
- package/src/core/auto-track.ts +152 -0
- package/src/core/buffer/index.ts +371 -0
- package/src/core/callback/index.ts +1 -0
- package/src/core/connection/index.ts +13 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/context/index.ts +21 -0
- package/src/core/environment/index.ts +7 -0
- package/src/core/events/index.ts +277 -0
- package/src/core/events/interfaces.ts +36 -0
- package/src/core/inspector/index.ts +14 -0
- package/src/core/page/add-page-context.ts +33 -0
- package/src/core/page/get-page-context.ts +140 -0
- package/src/core/page/index.ts +2 -0
- package/src/core/plugin/index.ts +12 -0
- package/src/core/query-string/gracefulDecodeURIComponent.ts +16 -0
- package/src/core/query-string/index.ts +64 -0
- package/src/core/query-string/pickPrefix.ts +20 -0
- package/src/core/queue/event-queue.ts +22 -0
- package/src/core/session/index.ts +107 -0
- package/src/core/stats/index.ts +15 -0
- package/src/core/stats/remote-metrics.ts +144 -0
- package/src/core/storage/cookieStorage.ts +80 -0
- package/src/core/storage/index.ts +64 -0
- package/src/core/storage/localStorage.ts +45 -0
- package/src/core/storage/memoryStorage.ts +22 -0
- package/src/core/storage/settings.ts +23 -0
- package/src/core/storage/types.ts +49 -0
- package/src/core/storage/universalStorage.ts +78 -0
- package/src/core/user/index.ts +399 -0
- package/src/core/user/migrate.ts +126 -0
- package/src/core/user/tld.ts +65 -0
- package/src/core/user/vendor/crypto-es/LICENSE +53 -0
- package/src/core/user/vendor/crypto-es/lib/aes.ts +302 -0
- package/src/core/user/vendor/crypto-es/lib/cipher-core.ts +922 -0
- package/src/core/user/vendor/crypto-es/lib/core.ts +806 -0
- package/src/core/user/vendor/crypto-es/lib/enc-base64.ts +110 -0
- package/src/core/user/vendor/crypto-es/lib/evpkdf.ts +110 -0
- package/src/core/user/vendor/crypto-es/lib/md5.ts +238 -0
- package/src/core/user/vendor/readme.md +7 -0
- package/src/generated/version.ts +2 -0
- package/src/index.ts +13 -0
- package/src/lib/bind-all.ts +19 -0
- package/src/lib/browser-polyfill.ts +23 -0
- package/src/lib/client-hints/index.ts +16 -0
- package/src/lib/client-hints/interfaces.ts +42 -0
- package/src/lib/create-deferred.ts +16 -0
- package/src/lib/csp-detection.ts +8 -0
- package/src/lib/embedded-write-key.ts +24 -0
- package/src/lib/fetch.ts +10 -0
- package/src/lib/get-global.ts +16 -0
- package/src/lib/get-process-env.ts +11 -0
- package/src/lib/global-analytics-helper.ts +31 -0
- package/src/lib/group-by.ts +30 -0
- package/src/lib/is-plan-event-enabled.ts +20 -0
- package/src/lib/is-thenable.ts +9 -0
- package/src/lib/load-script.ts +66 -0
- package/src/lib/merged-options.ts +46 -0
- package/src/lib/on-page-change.ts +29 -0
- package/src/lib/p-while.ts +12 -0
- package/src/lib/parse-cdn.ts +56 -0
- package/src/lib/pick.ts +28 -0
- package/src/lib/priority-queue/backoff.ts +24 -0
- package/src/lib/priority-queue/index.ts +6 -0
- package/src/lib/priority-queue/persisted.ts +127 -0
- package/src/lib/sleep.ts +4 -0
- package/src/lib/to-facade.ts +50 -0
- package/src/lib/version-type.ts +10 -0
- package/src/node/index.ts +36 -0
- package/src/node/node.browser.ts +7 -0
- package/src/plugins/ajs-destination/index.ts +392 -0
- package/src/plugins/ajs-destination/loader.ts +129 -0
- package/src/plugins/ajs-destination/types.ts +44 -0
- package/src/plugins/ajs-destination/utils.ts +32 -0
- package/src/plugins/analytics-node/index.ts +67 -0
- package/src/plugins/env-enrichment/index.ts +208 -0
- package/src/plugins/hightouchio/batched-dispatcher.ts +127 -0
- package/src/plugins/hightouchio/fetch-dispatcher.ts +27 -0
- package/src/plugins/hightouchio/index.ts +147 -0
- package/src/plugins/hightouchio/normalize.ts +71 -0
- package/src/plugins/hightouchio/schedule-flush.ts +58 -0
- package/src/plugins/legacy-video-plugins/index.ts +16 -0
- package/src/plugins/middleware/index.ts +131 -0
- package/src/plugins/remote-loader/index.ts +256 -0
- package/src/plugins/remote-middleware/index.ts +44 -0
- package/src/plugins/routing-middleware/index.ts +37 -0
- package/src/plugins/schema-filter/index.ts +90 -0
- package/src/plugins/validation/index.ts +44 -0
- package/src/test-helpers/browser-storage.ts +75 -0
- package/src/test-helpers/factories.ts +18 -0
- package/src/test-helpers/fetch-parse.ts +8 -0
- package/src/test-helpers/fixtures/cdn-settings.ts +301 -0
- package/src/test-helpers/fixtures/classic-destination.ts +25 -0
- package/src/test-helpers/fixtures/client-hints.ts +28 -0
- package/src/test-helpers/fixtures/create-fetch-method.ts +30 -0
- package/src/test-helpers/fixtures/index.ts +4 -0
- package/src/test-helpers/fixtures/page-context.ts +11 -0
- package/src/test-helpers/test-writekeys.ts +5 -0
- package/src/test-helpers/type-assertions.ts +11 -0
package/LICENSE.MD
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2023 Hightouch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
The MIT License (MIT)
|
|
26
|
+
|
|
27
|
+
Copyright © 2021 Segment
|
|
28
|
+
|
|
29
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
30
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
31
|
+
in the Software without restriction, including without limitation the rights
|
|
32
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
33
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
34
|
+
furnished to do so, subject to the following conditions:
|
|
35
|
+
|
|
36
|
+
The above copyright notice and this permission notice shall be included in
|
|
37
|
+
all copies or substantial portions of the Software.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
40
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
41
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
42
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
43
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
44
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
45
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# Events Javascript SDK
|
|
2
|
+
|
|
3
|
+
## Installation via CDN
|
|
4
|
+
|
|
5
|
+
To integrate the JavaScript SDK with your website, place the following code snippet in the `<head>` section of your website.
|
|
6
|
+
|
|
7
|
+
```javascript
|
|
8
|
+
<script type="text/javascript">
|
|
9
|
+
!function(){var e=window.htevents=window.htevents||[];if(!e.initialize)if(e.invoked)window.console&&console.error&&console.error("Hightouch snippet included twice.");else{e.invoked=!0,e.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"],e.factory=function(t){return function(){var n=Array.prototype.slice.call(arguments);return n.unshift(t),e.push(n),e}};for(var t=0;t<e.methods.length;t++){var n=e.methods[t];e[n]=e.factory(n)}e.load=function(t,n){var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src="https://cdn.hightouch-events.com/browser/release/v1-latest/events.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(o,r),e._loadOptions=n,e._writeKey=t},e.SNIPPET_VERSION="0.0.1",
|
|
10
|
+
e.load(<WRITE_KEY>,{apiHost:<DATA_PLANE_URL>}),
|
|
11
|
+
e.page()}}();
|
|
12
|
+
</script>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`window.htevents.track(...)` will then be available for use.
|
|
16
|
+
|
|
17
|
+
### Alternative installation using NPM
|
|
18
|
+
|
|
19
|
+
1. Install the package
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
# npm
|
|
23
|
+
npm install @ht-sdks/events-sdk-js-browser
|
|
24
|
+
|
|
25
|
+
# yarn
|
|
26
|
+
yarn add @ht-sdks/events-sdk-js-browser
|
|
27
|
+
|
|
28
|
+
# pnpm
|
|
29
|
+
pnpm add @ht-sdks/events-sdk-js-browser
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. Import the package into your project and you're good to go (with working types)!
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { AnalyticsBrowser } from '@ht-sdks/events-sdk-js-browser'
|
|
36
|
+
|
|
37
|
+
const analytics = AnalyticsBrowser.load({ writeKey: '<YOUR_WRITE_KEY>' })
|
|
38
|
+
|
|
39
|
+
analytics.identify('hello world')
|
|
40
|
+
|
|
41
|
+
document.body?.addEventListener('click', () => {
|
|
42
|
+
analytics.track('document body clicked!')
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Lazy / Delayed Loading
|
|
47
|
+
You can load a buffered version of analytics that requires `.load` to be explicitly called before initiating any network activity. This can be useful if you want to wait for a user to consent before fetching any tracking destinations or sending buffered events to hightouch.
|
|
48
|
+
|
|
49
|
+
- ⚠️ ️`.load` should only be called _once_.
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
export const analytics = new AnalyticsBrowser()
|
|
53
|
+
|
|
54
|
+
analytics.identify("hello world")
|
|
55
|
+
|
|
56
|
+
if (userConsentsToBeingTracked) {
|
|
57
|
+
analytics.load({ writeKey: '<YOUR_WRITE_KEY>' }) // destinations loaded, enqueued events are flushed
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Error Handling
|
|
62
|
+
### Handling initialization errors
|
|
63
|
+
If you want to catch initialization errors, you can do the following:
|
|
64
|
+
```ts
|
|
65
|
+
export const analytics = new AnalyticsBrowser();
|
|
66
|
+
analytics
|
|
67
|
+
.load({ writeKey: "MY_WRITE_KEY" })
|
|
68
|
+
.catch((err) => ...);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Usage in Common Frameworks / SPAs
|
|
72
|
+
|
|
73
|
+
### Vanilla React
|
|
74
|
+
```tsx
|
|
75
|
+
import { AnalyticsBrowser } from '@ht-sdks/events-sdk-js-browser'
|
|
76
|
+
|
|
77
|
+
// We can export this instance to share with rest of our codebase.
|
|
78
|
+
export const analytics = AnalyticsBrowser.load({ writeKey: '<YOUR_WRITE_KEY>' })
|
|
79
|
+
|
|
80
|
+
const App = () => (
|
|
81
|
+
<div>
|
|
82
|
+
<button onClick={() => analytics.track('hello world')}>Track</button>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Vue
|
|
90
|
+
|
|
91
|
+
1. Export analytics instance. E.g. `services/hightouch.ts`
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import { AnalyticsBrowser } from '@ht-sdks/events-sdk-js-browser'
|
|
95
|
+
|
|
96
|
+
export const analytics = AnalyticsBrowser.load({
|
|
97
|
+
writeKey: '<YOUR_WRITE_KEY>',
|
|
98
|
+
})
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
2. in `.vue` component
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<template>
|
|
105
|
+
<button @click="track()">Track</button>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<script>
|
|
109
|
+
import { defineComponent } from 'vue'
|
|
110
|
+
import { analytics } from './services/hightouch'
|
|
111
|
+
|
|
112
|
+
export default defineComponent({
|
|
113
|
+
setup() {
|
|
114
|
+
function track() {
|
|
115
|
+
analytics.track('Hello world')
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
track,
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
</script>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## How to add typescript support when using the CDN snippet
|
|
127
|
+
|
|
128
|
+
NOTE: this is only required for snippet installation.
|
|
129
|
+
|
|
130
|
+
NPM installation should already have type support.
|
|
131
|
+
|
|
132
|
+
1. Install npm package `@ht-sdks/events-sdk-js-browser` as a dev dependency.
|
|
133
|
+
|
|
134
|
+
2. Create `./typings/htevents.d.ts`
|
|
135
|
+
```ts
|
|
136
|
+
// ./typings/analytics.d.ts
|
|
137
|
+
import type { AnalyticsSnippet } from "@ht-sdks/events-sdk-js-browser";
|
|
138
|
+
|
|
139
|
+
declare global {
|
|
140
|
+
interface Window {
|
|
141
|
+
htevents: AnalyticsSnippet;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
3. Configure typescript to read from the custom `./typings` folder
|
|
147
|
+
```jsonc
|
|
148
|
+
// tsconfig.json
|
|
149
|
+
{
|
|
150
|
+
...
|
|
151
|
+
"compilerOptions": {
|
|
152
|
+
....
|
|
153
|
+
"typeRoots": [
|
|
154
|
+
"./node_modules/@types",
|
|
155
|
+
"./typings"
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
....
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Development
|
|
165
|
+
|
|
166
|
+
First, clone the repo and then startup our local dev environment:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
$ git clone git@github.com:ht-sdks/events-sdk-js-mono.git
|
|
170
|
+
$ cd events-sdk-js-mono
|
|
171
|
+
$ nvm use # installs correct version of node defined in .nvmrc.
|
|
172
|
+
$ yarn && yarn build
|
|
173
|
+
$ yarn test
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
> If you get "Cannot find module '@ht-sdks/events-sdk-js-browser' or its corresponding type declarations.ts(2307)" (in VSCode), you may have to "cmd+shift+p -> "TypeScript: Restart TS server"
|
|
177
|
+
|
|
178
|
+
# Plugins
|
|
179
|
+
|
|
180
|
+
When developing against Events SDK JS you will likely be writing plugins, which can augment functionality and enrich data. Plugins are isolated chunks which you can build, test, version, and deploy independently of the rest of the codebase. Plugins are bounded by Events SDK JS which handles things such as observability, retries, and error management.
|
|
181
|
+
|
|
182
|
+
Plugins can be of two different priorities:
|
|
183
|
+
|
|
184
|
+
1. **Critical**: Events SDK JS should expect this plugin to be loaded before starting event delivery
|
|
185
|
+
2. **Non-critical**: Events SDK JS can start event delivery before this plugin has finished loading
|
|
186
|
+
|
|
187
|
+
and can be of five different types:
|
|
188
|
+
|
|
189
|
+
1. **Before**: Plugins that need to be run before any other plugins are run. An example of this would be validating events before passing them along to other plugins.
|
|
190
|
+
2. **After**: Plugins that need to run after all other plugins have run. An example of this is the Hightouch.io integration, which will wait for destinations to succeed or fail so that it can send its observability metrics.
|
|
191
|
+
3. **Destination**: Destinations to send the event to (ie. legacy destinations). Does not modify the event and failure does not halt execution.
|
|
192
|
+
4. **Enrichment**: Modifies an event, failure here could halt the event pipeline.
|
|
193
|
+
5. **Utility**: Plugins that change Events SDK JS functionality and don't fall into the other categories.
|
|
194
|
+
|
|
195
|
+
Here is an example of a simple plugin that would convert all track events event names to lowercase before the event gets sent through the rest of the pipeline:
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
import type { Plugin } from '@ht-sdks/events-sdk-js-browser'
|
|
199
|
+
|
|
200
|
+
export const lowercase: Plugin = {
|
|
201
|
+
name: 'Lowercase Event Name',
|
|
202
|
+
type: 'before',
|
|
203
|
+
version: '1.0.0',
|
|
204
|
+
|
|
205
|
+
isLoaded: () => true,
|
|
206
|
+
load: () => Promise.resolve(),
|
|
207
|
+
|
|
208
|
+
track: (ctx) => {
|
|
209
|
+
ctx.event.event = ctx.event.event.toLowerCase()
|
|
210
|
+
return ctx
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
analytics.register(lowercase)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
For further examples check out our [existing plugins](/packages/browser/src/plugins).
|
|
218
|
+
|
|
219
|
+
## QA
|
|
220
|
+
Feature work and bug fixes should include tests. Run all [Jest](https://jestjs.io) tests:
|
|
221
|
+
```
|
|
222
|
+
$ yarn test
|
|
223
|
+
```
|
|
224
|
+
Lint all with [ESLint](https://github.com/typescript-eslint/typescript-eslint/):
|
|
225
|
+
```
|
|
226
|
+
$ yarn lint
|
|
227
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var parse_cdn_1 = require("../lib/parse-cdn");
|
|
5
|
+
var version_type_1 = require("../lib/version-type");
|
|
6
|
+
if (process.env.ASSET_PATH) {
|
|
7
|
+
if (process.env.ASSET_PATH === '/dist/umd/') {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
__webpack_public_path__ = '/dist/umd/';
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
var cdn = (0, parse_cdn_1.getCDN)();
|
|
13
|
+
(0, parse_cdn_1.setGlobalCDNUrl)(cdn); // preserving original behavior -- TODO: neccessary?
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
__webpack_public_path__ =
|
|
16
|
+
cdn + "/".concat(process.env.PATH_PREFIX, "/").concat(process.env.PATH_VERSION, "/");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
(0, version_type_1.setVersionType)('web');
|
|
20
|
+
tslib_1.__exportStar(require("."), exports);
|
|
21
|
+
//# sourceMappingURL=browser-umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-umd.js","sourceRoot":"","sources":["../../../src/browser/browser-umd.ts"],"names":[],"mappings":";;;AAAA,8CAA0D;AAC1D,oDAAoD;AAEpD,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE;IAC1B,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,YAAY,EAAE;QAC3C,aAAa;QACb,uBAAuB,GAAG,YAAY,CAAA;KACvC;SAAM;QACL,IAAM,GAAG,GAAG,IAAA,kBAAM,GAAE,CAAA;QACpB,IAAA,2BAAe,EAAC,GAAG,CAAC,CAAA,CAAC,oDAAoD;QACzE,aAAa;QACb,uBAAuB;YACrB,GAAG,GAAG,WAAI,OAAO,CAAC,GAAG,CAAC,WAAW,cAAI,OAAO,CAAC,GAAG,CAAC,YAAY,MAAG,CAAA;KACnE;CACF;AAED,IAAA,6BAAc,EAAC,KAAK,CAAC,CAAA;AAErB,4CAAiB"}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalyticsBrowser = exports.loadLegacySettings = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var get_process_env_1 = require("../lib/get-process-env");
|
|
6
|
+
var parse_cdn_1 = require("../lib/parse-cdn");
|
|
7
|
+
var fetch_1 = require("../lib/fetch");
|
|
8
|
+
var analytics_1 = require("../core/analytics");
|
|
9
|
+
var merged_options_1 = require("../lib/merged-options");
|
|
10
|
+
var create_deferred_1 = require("../lib/create-deferred");
|
|
11
|
+
var env_enrichment_1 = require("../plugins/env-enrichment");
|
|
12
|
+
var remote_loader_1 = require("../plugins/remote-loader");
|
|
13
|
+
var hightouchio_1 = require("../plugins/hightouchio");
|
|
14
|
+
var validation_1 = require("../plugins/validation");
|
|
15
|
+
var buffer_1 = require("../core/buffer");
|
|
16
|
+
var inspector_1 = require("../core/inspector");
|
|
17
|
+
var global_analytics_helper_1 = require("../lib/global-analytics-helper");
|
|
18
|
+
function loadLegacySettings(writeKey, cdnURL) {
|
|
19
|
+
var baseUrl = cdnURL !== null && cdnURL !== void 0 ? cdnURL : (0, parse_cdn_1.getCDN)();
|
|
20
|
+
return (0, fetch_1.fetch)("".concat(baseUrl, "/v1/projects/").concat(writeKey, "/settings"))
|
|
21
|
+
.then(function (res) {
|
|
22
|
+
if (!res.ok) {
|
|
23
|
+
return res.text().then(function (errorResponseMessage) {
|
|
24
|
+
throw new Error(errorResponseMessage);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return res.json();
|
|
28
|
+
})
|
|
29
|
+
.catch(function (err) {
|
|
30
|
+
console.error(err.message);
|
|
31
|
+
throw err;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.loadLegacySettings = loadLegacySettings;
|
|
35
|
+
function hasLegacyDestinations(settings) {
|
|
36
|
+
return ((0, get_process_env_1.getProcessEnv)().NODE_ENV !== 'test' &&
|
|
37
|
+
// just one integration means hightouchio
|
|
38
|
+
Object.keys(settings.integrations).length > 1);
|
|
39
|
+
}
|
|
40
|
+
function hasTsubMiddleware(settings) {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
return ((0, get_process_env_1.getProcessEnv)().NODE_ENV !== 'test' &&
|
|
43
|
+
((_c = (_b = (_a = settings.middlewareSettings) === null || _a === void 0 ? void 0 : _a.routingRules) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* With AJS classic, we allow users to call setAnonymousId before the library initialization.
|
|
47
|
+
* This is important because some of the destinations will use the anonymousId during the initialization,
|
|
48
|
+
* and if we set anonId afterwards, that wouldn’t impact the destination.
|
|
49
|
+
*
|
|
50
|
+
* Also Ensures events can be registered before library initialization.
|
|
51
|
+
* This is important so users can register to 'initialize' and any events that may fire early during setup.
|
|
52
|
+
*/
|
|
53
|
+
function flushPreBuffer(analytics, buffer) {
|
|
54
|
+
(0, buffer_1.flushSetAnonymousID)(analytics, buffer);
|
|
55
|
+
(0, buffer_1.flushOn)(analytics, buffer);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Finish flushing buffer and cleanup.
|
|
59
|
+
*/
|
|
60
|
+
function flushFinalBuffer(analytics, buffer) {
|
|
61
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
62
|
+
return tslib_1.__generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
64
|
+
case 0:
|
|
65
|
+
// Call popSnippetWindowBuffer before each flush task since there may be
|
|
66
|
+
// analytics calls during async function calls.
|
|
67
|
+
return [4 /*yield*/, (0, buffer_1.flushAddSourceMiddleware)(analytics, buffer)];
|
|
68
|
+
case 1:
|
|
69
|
+
// Call popSnippetWindowBuffer before each flush task since there may be
|
|
70
|
+
// analytics calls during async function calls.
|
|
71
|
+
_a.sent();
|
|
72
|
+
(0, buffer_1.flushAnalyticsCallsInNewTask)(analytics, buffer);
|
|
73
|
+
// Clear buffer, just in case analytics is loaded twice; we don't want to fire events off again.
|
|
74
|
+
buffer.clear();
|
|
75
|
+
return [2 /*return*/];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function registerPlugins(writeKey, legacySettings, analytics, opts, options, pluginLikes, legacyIntegrationSources) {
|
|
81
|
+
var _a, _b, _c;
|
|
82
|
+
if (pluginLikes === void 0) { pluginLikes = []; }
|
|
83
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var plugins, pluginSources, tsubMiddleware, _d, legacyDestinations, _e, schemaFilter, _f, mergedSettings, remotePlugins, toRegister, shouldIgnoreHightouchio, _g, _h, ctx;
|
|
85
|
+
var _this = this;
|
|
86
|
+
return tslib_1.__generator(this, function (_j) {
|
|
87
|
+
switch (_j.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
plugins = pluginLikes === null || pluginLikes === void 0 ? void 0 : pluginLikes.filter(function (pluginLike) { return typeof pluginLike === 'object'; });
|
|
90
|
+
pluginSources = pluginLikes === null || pluginLikes === void 0 ? void 0 : pluginLikes.filter(function (pluginLike) {
|
|
91
|
+
return typeof pluginLike === 'function' &&
|
|
92
|
+
typeof pluginLike.pluginName === 'string';
|
|
93
|
+
});
|
|
94
|
+
if (!hasTsubMiddleware(legacySettings)) return [3 /*break*/, 2];
|
|
95
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return tslib_1.__importStar(require(
|
|
96
|
+
/* webpackChunkName: "tsub-middleware" */ '../plugins/routing-middleware')); }).then(function (mod) {
|
|
97
|
+
return mod.tsubMiddleware(legacySettings.middlewareSettings.routingRules);
|
|
98
|
+
})];
|
|
99
|
+
case 1:
|
|
100
|
+
_d = _j.sent();
|
|
101
|
+
return [3 /*break*/, 3];
|
|
102
|
+
case 2:
|
|
103
|
+
_d = undefined;
|
|
104
|
+
_j.label = 3;
|
|
105
|
+
case 3:
|
|
106
|
+
tsubMiddleware = _d;
|
|
107
|
+
if (!(hasLegacyDestinations(legacySettings) || legacyIntegrationSources.length > 0)) return [3 /*break*/, 5];
|
|
108
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return tslib_1.__importStar(require(
|
|
109
|
+
/* webpackChunkName: "ajs-destination" */ '../plugins/ajs-destination')); }).then(function (mod) {
|
|
110
|
+
return mod.ajsDestinations(writeKey, legacySettings, analytics.integrations, opts, tsubMiddleware, legacyIntegrationSources);
|
|
111
|
+
})];
|
|
112
|
+
case 4:
|
|
113
|
+
_e = _j.sent();
|
|
114
|
+
return [3 /*break*/, 6];
|
|
115
|
+
case 5:
|
|
116
|
+
_e = [];
|
|
117
|
+
_j.label = 6;
|
|
118
|
+
case 6:
|
|
119
|
+
legacyDestinations = _e;
|
|
120
|
+
if (!legacySettings.legacyVideoPluginsEnabled) return [3 /*break*/, 8];
|
|
121
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return tslib_1.__importStar(require(
|
|
122
|
+
/* webpackChunkName: "legacyVideos" */ '../plugins/legacy-video-plugins')); }).then(function (mod) {
|
|
123
|
+
return mod.loadLegacyVideoPlugins(analytics);
|
|
124
|
+
})];
|
|
125
|
+
case 7:
|
|
126
|
+
_j.sent();
|
|
127
|
+
_j.label = 8;
|
|
128
|
+
case 8:
|
|
129
|
+
if (!((_a = opts.plan) === null || _a === void 0 ? void 0 : _a.track)) return [3 /*break*/, 10];
|
|
130
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return tslib_1.__importStar(require(
|
|
131
|
+
/* webpackChunkName: "schemaFilter" */ '../plugins/schema-filter')); }).then(function (mod) {
|
|
132
|
+
var _a;
|
|
133
|
+
return mod.schemaFilter((_a = opts.plan) === null || _a === void 0 ? void 0 : _a.track, legacySettings);
|
|
134
|
+
})];
|
|
135
|
+
case 9:
|
|
136
|
+
_f = _j.sent();
|
|
137
|
+
return [3 /*break*/, 11];
|
|
138
|
+
case 10:
|
|
139
|
+
_f = undefined;
|
|
140
|
+
_j.label = 11;
|
|
141
|
+
case 11:
|
|
142
|
+
schemaFilter = _f;
|
|
143
|
+
mergedSettings = (0, merged_options_1.mergedOptions)(legacySettings, options);
|
|
144
|
+
return [4 /*yield*/, (0, remote_loader_1.remoteLoader)(legacySettings, analytics.integrations, mergedSettings, options.obfuscate, tsubMiddleware, pluginSources).catch(function () { return []; })];
|
|
145
|
+
case 12:
|
|
146
|
+
remotePlugins = _j.sent();
|
|
147
|
+
toRegister = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([
|
|
148
|
+
validation_1.validation,
|
|
149
|
+
env_enrichment_1.envEnrichment
|
|
150
|
+
], plugins, true), legacyDestinations, true), remotePlugins, true);
|
|
151
|
+
if (schemaFilter) {
|
|
152
|
+
toRegister.push(schemaFilter);
|
|
153
|
+
}
|
|
154
|
+
shouldIgnoreHightouchio = (((_b = opts.integrations) === null || _b === void 0 ? void 0 : _b.All) === false && !opts.integrations['Hightouch.io']) ||
|
|
155
|
+
(opts.integrations && opts.integrations['Hightouch.io'] === false);
|
|
156
|
+
if (!!shouldIgnoreHightouchio) return [3 /*break*/, 14];
|
|
157
|
+
_h = (_g = toRegister).push;
|
|
158
|
+
return [4 /*yield*/, (0, hightouchio_1.hightouchio)(analytics, mergedSettings['Hightouch.io'], legacySettings.integrations)];
|
|
159
|
+
case 13:
|
|
160
|
+
_h.apply(_g, [_j.sent()]);
|
|
161
|
+
_j.label = 14;
|
|
162
|
+
case 14: return [4 /*yield*/, analytics.register.apply(analytics, toRegister)];
|
|
163
|
+
case 15:
|
|
164
|
+
ctx = _j.sent();
|
|
165
|
+
if (!Object.entries((_c = legacySettings.enabledMiddleware) !== null && _c !== void 0 ? _c : {}).some(function (_a) {
|
|
166
|
+
var enabled = _a[1];
|
|
167
|
+
return enabled;
|
|
168
|
+
})) return [3 /*break*/, 17];
|
|
169
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return tslib_1.__importStar(require(
|
|
170
|
+
/* webpackChunkName: "remoteMiddleware" */ '../plugins/remote-middleware')); }).then(function (_a) {
|
|
171
|
+
var remoteMiddlewares = _a.remoteMiddlewares;
|
|
172
|
+
return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
173
|
+
var middleware, promises;
|
|
174
|
+
return tslib_1.__generator(this, function (_b) {
|
|
175
|
+
switch (_b.label) {
|
|
176
|
+
case 0: return [4 /*yield*/, remoteMiddlewares(ctx, legacySettings, options.obfuscate)];
|
|
177
|
+
case 1:
|
|
178
|
+
middleware = _b.sent();
|
|
179
|
+
promises = middleware.map(function (mdw) {
|
|
180
|
+
return analytics.addSourceMiddleware(mdw);
|
|
181
|
+
});
|
|
182
|
+
return [2 /*return*/, Promise.all(promises)];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
})];
|
|
187
|
+
case 16:
|
|
188
|
+
_j.sent();
|
|
189
|
+
_j.label = 17;
|
|
190
|
+
case 17: return [2 /*return*/, ctx];
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
var defaultHightouchIntegration = {
|
|
196
|
+
apiKey: 'WRITE_KEY',
|
|
197
|
+
apiHost: 'us-east-1.hightouch-events.com',
|
|
198
|
+
protocol: 'https',
|
|
199
|
+
unbundledIntegrations: [],
|
|
200
|
+
addBundledMetadata: false,
|
|
201
|
+
maybeBundledConfigIds: {},
|
|
202
|
+
deliveryStrategy: {
|
|
203
|
+
strategy: 'batching',
|
|
204
|
+
config: { timeout: 1000, size: 10 }, // 1 second or 10 items
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
var defaultSettings = {
|
|
208
|
+
integrations: {},
|
|
209
|
+
plan: {
|
|
210
|
+
track: { __default: { enabled: true, integrations: {} } },
|
|
211
|
+
identify: { __default: { enabled: true } },
|
|
212
|
+
group: { __default: { enabled: true } },
|
|
213
|
+
},
|
|
214
|
+
enabledMiddleware: {},
|
|
215
|
+
metrics: { sampleRate: 0.0 },
|
|
216
|
+
legacyVideoPluginsEnabled: false,
|
|
217
|
+
remotePlugins: [],
|
|
218
|
+
};
|
|
219
|
+
function loadAnalytics(settings, options, preInitBuffer) {
|
|
220
|
+
var _a, _b, _c, _d, _e, _f;
|
|
221
|
+
if (options === void 0) { options = {}; }
|
|
222
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
223
|
+
var legacySettings, retryQueue, opts, analytics, plugins, classicIntegrations, ctx, search, hash, term;
|
|
224
|
+
return tslib_1.__generator(this, function (_g) {
|
|
225
|
+
switch (_g.label) {
|
|
226
|
+
case 0:
|
|
227
|
+
if (options.globalAnalyticsKey)
|
|
228
|
+
(0, global_analytics_helper_1.setGlobalAnalyticsKey)(options.globalAnalyticsKey);
|
|
229
|
+
// this is an ugly side-effect, but it's for the benefits of the plugins that get their cdn via getCDN()
|
|
230
|
+
if (settings.cdnURL)
|
|
231
|
+
(0, parse_cdn_1.setGlobalCDNUrl)(settings.cdnURL);
|
|
232
|
+
if (settings.cdnSettings) {
|
|
233
|
+
legacySettings = settings.cdnSettings;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
defaultSettings.integrations['Hightouch.io'] = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, defaultHightouchIntegration), (settings.writeKey ? { apiKey: settings.writeKey } : {})), (options.apiHost ? { apiHost: options.apiHost } : {})), (options.protocol ? { protocol: options.protocol } : {})), (options.batching == false
|
|
237
|
+
? {
|
|
238
|
+
deliveryStrategy: {
|
|
239
|
+
strategy: 'standard',
|
|
240
|
+
},
|
|
241
|
+
}
|
|
242
|
+
: {}));
|
|
243
|
+
legacySettings = defaultSettings;
|
|
244
|
+
}
|
|
245
|
+
if (options.updateCDNSettings) {
|
|
246
|
+
legacySettings = options.updateCDNSettings(legacySettings);
|
|
247
|
+
}
|
|
248
|
+
retryQueue = (_b = (_a = legacySettings.integrations['Hightouch.io']) === null || _a === void 0 ? void 0 : _a.retryQueue) !== null && _b !== void 0 ? _b : true;
|
|
249
|
+
opts = tslib_1.__assign({ retryQueue: retryQueue }, options);
|
|
250
|
+
analytics = new analytics_1.Analytics(settings, opts);
|
|
251
|
+
(0, inspector_1.attachInspector)(analytics);
|
|
252
|
+
plugins = (_c = settings.plugins) !== null && _c !== void 0 ? _c : [];
|
|
253
|
+
classicIntegrations = (_d = settings.classicIntegrations) !== null && _d !== void 0 ? _d : [];
|
|
254
|
+
// Uncomment to re-enable RemoteMetrics -- also see standalone.ts RemoteMetrics usage
|
|
255
|
+
// Stats.initRemoteMetrics(legacySettings.metrics)
|
|
256
|
+
// needs to be flushed before plugins are registered
|
|
257
|
+
flushPreBuffer(analytics, preInitBuffer);
|
|
258
|
+
return [4 /*yield*/, registerPlugins(settings.writeKey, legacySettings, analytics, opts, options, plugins, classicIntegrations)];
|
|
259
|
+
case 1:
|
|
260
|
+
ctx = _g.sent();
|
|
261
|
+
search = (_e = window.location.search) !== null && _e !== void 0 ? _e : '';
|
|
262
|
+
hash = (_f = window.location.hash) !== null && _f !== void 0 ? _f : '';
|
|
263
|
+
term = search.length ? search : hash.replace(/(?=#).*(?=\?)/, '');
|
|
264
|
+
if (!term.includes('ajs_')) return [3 /*break*/, 3];
|
|
265
|
+
return [4 /*yield*/, analytics.queryString(term).catch(console.error)];
|
|
266
|
+
case 2:
|
|
267
|
+
_g.sent();
|
|
268
|
+
_g.label = 3;
|
|
269
|
+
case 3:
|
|
270
|
+
analytics.initialized = true;
|
|
271
|
+
analytics.emit('initialize', settings, options);
|
|
272
|
+
if (options.initialPageview) {
|
|
273
|
+
analytics.page().catch(console.error);
|
|
274
|
+
}
|
|
275
|
+
return [4 /*yield*/, flushFinalBuffer(analytics, preInitBuffer)];
|
|
276
|
+
case 4:
|
|
277
|
+
_g.sent();
|
|
278
|
+
return [2 /*return*/, [analytics, ctx]];
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* The public browser interface for Segment Analytics
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```ts
|
|
288
|
+
* export const analytics = new AnalyticsBrowser()
|
|
289
|
+
* analytics.load({ writeKey: 'foo' })
|
|
290
|
+
* ```
|
|
291
|
+
* @link https://github.com/ht-sdks/events-sdk-js-mono/tree/master/packages/browser#readme
|
|
292
|
+
*/
|
|
293
|
+
var AnalyticsBrowser = /** @class */ (function (_super) {
|
|
294
|
+
tslib_1.__extends(AnalyticsBrowser, _super);
|
|
295
|
+
function AnalyticsBrowser() {
|
|
296
|
+
var _this = this;
|
|
297
|
+
var _a = (0, create_deferred_1.createDeferred)(), loadStart = _a.promise, resolveLoadStart = _a.resolve;
|
|
298
|
+
_this = _super.call(this, function (buffer) {
|
|
299
|
+
return loadStart.then(function (_a) {
|
|
300
|
+
var settings = _a[0], options = _a[1];
|
|
301
|
+
return loadAnalytics(settings, options, buffer);
|
|
302
|
+
});
|
|
303
|
+
}) || this;
|
|
304
|
+
_this._resolveLoadStart = function (settings, options) {
|
|
305
|
+
return resolveLoadStart([settings, options]);
|
|
306
|
+
};
|
|
307
|
+
return _this;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Fully initialize an analytics instance, including:
|
|
311
|
+
*
|
|
312
|
+
* * Fetching settings from the CDN (by default).
|
|
313
|
+
* * Fetching all remote destinations configured by the user (if applicable).
|
|
314
|
+
* * Flushing buffered analytics events.
|
|
315
|
+
* * Loading all middleware.
|
|
316
|
+
*
|
|
317
|
+
* Note:️ This method should only be called *once* in your application.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```ts
|
|
321
|
+
* export const analytics = new AnalyticsBrowser()
|
|
322
|
+
* analytics.load({ writeKey: 'foo' })
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
AnalyticsBrowser.prototype.load = function (settings, options) {
|
|
326
|
+
if (options === void 0) { options = {}; }
|
|
327
|
+
this._resolveLoadStart(settings, options);
|
|
328
|
+
return this;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Instantiates an object exposing Analytics methods.
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```ts
|
|
335
|
+
* const ajs = AnalyticsBrowser.load({ writeKey: '<YOUR_WRITE_KEY>' })
|
|
336
|
+
*
|
|
337
|
+
* ajs.track("foo")
|
|
338
|
+
* ...
|
|
339
|
+
* ```
|
|
340
|
+
*/
|
|
341
|
+
AnalyticsBrowser.load = function (settings, options) {
|
|
342
|
+
if (options === void 0) { options = {}; }
|
|
343
|
+
return new AnalyticsBrowser().load(settings, options);
|
|
344
|
+
};
|
|
345
|
+
AnalyticsBrowser.standalone = function (writeKey, options) {
|
|
346
|
+
return AnalyticsBrowser.load({ writeKey: writeKey }, options).then(function (res) { return res[0]; });
|
|
347
|
+
};
|
|
348
|
+
return AnalyticsBrowser;
|
|
349
|
+
}(buffer_1.AnalyticsBuffered));
|
|
350
|
+
exports.AnalyticsBrowser = AnalyticsBrowser;
|
|
351
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":";;;;AAAA,0DAAsD;AACtD,8CAA0D;AAE1D,sCAAoC;AACpC,+CAA6E;AAK7E,wDAAqD;AACrD,0DAAuD;AACvD,4DAAyD;AACzD,0DAIiC;AAEjC,sDAAyE;AACzE,oDAAkD;AAClD,yCAOuB;AAEvB,+CAAmD;AACnD,0EAAsE;AA6EtE,SAAgB,kBAAkB,CAChC,QAAgB,EAChB,MAAe;IAEf,IAAM,OAAO,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAA,kBAAM,GAAE,CAAA;IAElC,OAAO,IAAA,aAAK,EAAC,UAAG,OAAO,0BAAgB,QAAQ,cAAW,CAAC;SACxD,IAAI,CAAC,UAAC,GAAG;QACR,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;YACX,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,UAAC,oBAAoB;gBAC1C,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;YACvC,CAAC,CAAC,CAAA;SACH;QACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;IACnB,CAAC,CAAC;SACD,KAAK,CAAC,UAAC,GAAG;QACT,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC1B,MAAM,GAAG,CAAA;IACX,CAAC,CAAC,CAAA;AACN,CAAC;AAnBD,gDAmBC;AAED,SAAS,qBAAqB,CAAC,QAAwB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