@zoho_apptics/apptics-js-sdk 2.0.0-beta.2 → 2.0.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/CHANGELOG.md +47 -0
- package/README.md +229 -174
- package/dist/apptics-pn-sw.js +3 -0
- package/dist/apptics-pn-sw.js.map +1 -0
- package/dist/apptics.esm.min.js +2 -2
- package/dist/apptics.esm.min.js.map +1 -1
- package/dist/apptics.min.js +2 -2
- package/dist/apptics.min.js.map +1 -1
- package/dist/chunks/batch-Axq9sTzR.min.js +3 -0
- package/dist/chunks/batch-Axq9sTzR.min.js.map +1 -0
- package/dist/chunks/lifecycle-Cvg78jN_.min.js +3 -0
- package/dist/chunks/lifecycle-Cvg78jN_.min.js.map +1 -0
- package/dist/chunks/send-DBpesydB.min.js +3 -0
- package/dist/chunks/send-DBpesydB.min.js.map +1 -0
- package/dist/chunks/transport-B21X39p4.min.js +3 -0
- package/dist/chunks/transport-B21X39p4.min.js.map +1 -0
- package/dist/cjs/core/attempts.js +1 -1
- package/dist/cjs/core/batch.js +4 -3
- package/dist/cjs/core/consent.d.ts +9 -6
- package/dist/cjs/core/consent.js +63 -10
- package/dist/cjs/core/console-call.d.ts +23 -0
- package/dist/cjs/core/console-call.js +63 -0
- package/dist/cjs/core/constants.d.ts +44 -0
- package/dist/cjs/core/constants.js +55 -1
- package/dist/cjs/core/db.js +31 -7
- package/dist/cjs/core/debug.d.ts +6 -4
- package/dist/cjs/core/debug.js +36 -12
- package/dist/cjs/core/env.js +1 -1
- package/dist/cjs/core/framework-id.d.ts +1 -1
- package/dist/cjs/core/framework-id.js +3 -3
- package/dist/cjs/core/guard.js +19 -4
- package/dist/cjs/core/hooks.d.ts +25 -1
- package/dist/cjs/core/hooks.js +11 -1
- package/dist/cjs/core/locks.js +1 -1
- package/dist/cjs/core/logger.js +1 -1
- package/dist/cjs/core/shield.d.ts +31 -0
- package/dist/cjs/core/shield.js +129 -0
- package/dist/cjs/core/state.d.ts +5 -1
- package/dist/cjs/core/state.js +3 -1
- package/dist/cjs/core/storage.d.ts +7 -0
- package/dist/cjs/core/storage.js +28 -6
- package/dist/cjs/core/stylesheet.js +1 -1
- package/dist/cjs/core/transport.d.ts +15 -4
- package/dist/cjs/core/transport.js +63 -13
- package/dist/cjs/core/utils.js +1 -1
- package/dist/cjs/core/validate.js +6 -5
- package/dist/cjs/device/appversion.js +1 -1
- package/dist/cjs/device/index.js +63 -15
- package/dist/cjs/engagement/api-rules.js +1 -1
- package/dist/cjs/engagement/auto-api.js +4 -3
- package/dist/cjs/engagement/auto-screen.js +10 -6
- package/dist/cjs/engagement/defined-events.d.ts +2 -3
- package/dist/cjs/engagement/defined-events.js +10 -16
- package/dist/cjs/engagement/send.js +1 -1
- package/dist/cjs/engagement/session.js +77 -37
- package/dist/cjs/engagement/track.js +9 -6
- package/dist/cjs/errors/send.js +1 -1
- package/dist/cjs/errors/track.js +3 -2
- package/dist/cjs/feedback/controls.d.ts +30 -4
- package/dist/cjs/feedback/controls.js +237 -51
- package/dist/cjs/feedback/i18n/index.d.ts +31 -0
- package/dist/cjs/feedback/i18n/index.js +187 -0
- package/dist/cjs/feedback/i18n/strings.d.ts +9 -0
- package/dist/cjs/feedback/i18n/strings.js +8 -0
- package/dist/cjs/feedback/index.js +1 -1
- package/dist/cjs/feedback/logs.js +5 -4
- package/dist/cjs/feedback/quartz.js +5 -2
- package/dist/cjs/feedback/send.d.ts +4 -1
- package/dist/cjs/feedback/send.js +56 -15
- package/dist/cjs/feedback/styles.js +2 -2
- package/dist/cjs/feedback/template.d.ts +4 -2
- package/dist/cjs/feedback/template.js +67 -46
- package/dist/cjs/feedback/ui.d.ts +40 -4
- package/dist/cjs/feedback/ui.js +208 -89
- package/dist/cjs/heatmap/send.js +1 -1
- package/dist/cjs/heatmap/track.js +13 -9
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/lifecycle.js +119 -72
- package/dist/cjs/pushnotification/display.d.ts +65 -0
- package/dist/cjs/pushnotification/display.js +112 -0
- package/dist/cjs/pushnotification/index.d.ts +20 -0
- package/dist/cjs/pushnotification/index.js +96 -0
- package/dist/cjs/pushnotification/kept-opens.d.ts +23 -0
- package/dist/cjs/pushnotification/kept-opens.js +64 -0
- package/dist/cjs/pushnotification/notify.d.ts +45 -0
- package/dist/cjs/pushnotification/notify.js +476 -0
- package/dist/cjs/pushnotification/payload.d.ts +65 -0
- package/dist/cjs/pushnotification/payload.js +279 -0
- package/dist/cjs/pushnotification/session.d.ts +46 -0
- package/dist/cjs/pushnotification/session.js +413 -0
- package/dist/cjs/pushnotification/stats.d.ts +45 -0
- package/dist/cjs/pushnotification/stats.js +244 -0
- package/dist/cjs/pushnotification/wms.d.ts +30 -0
- package/dist/cjs/pushnotification/wms.js +374 -0
- package/dist/cjs/remoteconfig/country.js +1 -1
- package/dist/cjs/remoteconfig/custom.js +4 -3
- package/dist/cjs/remoteconfig/evaluate.js +1 -1
- package/dist/cjs/remoteconfig/fetch.js +27 -8
- package/dist/cjs/remoteconfig/index.d.ts +1 -6
- package/dist/cjs/remoteconfig/index.js +4 -28
- package/dist/cjs/remoteconfig/store.js +1 -1
- package/dist/cjs/remoteconfig/tz-countries.js +1 -1
- package/dist/cjs/remotelog/callsite.js +1 -1
- package/dist/cjs/remotelog/gate.js +1 -1
- package/dist/cjs/remotelog/logger.js +1 -1
- package/dist/cjs/remotelog/send.js +5 -4
- package/dist/cjs/remotelogger/index.js +1 -1
- package/dist/cjs/scheduler.js +11 -5
- package/dist/cjs/sw/apptics-pn-sw.d.ts +83 -0
- package/dist/cjs/sw/timers.d.ts +44 -0
- package/dist/cjs/types.d.ts +31 -15
- package/dist/cjs/user/index.d.ts +7 -0
- package/dist/cjs/user/index.js +25 -7
- package/dist/esm/core/attempts.js +1 -1
- package/dist/esm/core/batch.js +4 -3
- package/dist/esm/core/consent.d.ts +9 -6
- package/dist/esm/core/consent.js +67 -16
- package/dist/esm/core/console-call.d.ts +23 -0
- package/dist/esm/core/console-call.js +60 -0
- package/dist/esm/core/constants.d.ts +44 -0
- package/dist/esm/core/constants.js +52 -2
- package/dist/esm/core/db.js +31 -7
- package/dist/esm/core/debug.d.ts +6 -4
- package/dist/esm/core/debug.js +37 -13
- package/dist/esm/core/env.js +1 -1
- package/dist/esm/core/framework-id.d.ts +1 -1
- package/dist/esm/core/framework-id.js +3 -3
- package/dist/esm/core/guard.js +19 -4
- package/dist/esm/core/hooks.d.ts +25 -1
- package/dist/esm/core/hooks.js +11 -1
- package/dist/esm/core/locks.js +1 -1
- package/dist/esm/core/logger.js +1 -1
- package/dist/esm/core/shield.d.ts +31 -0
- package/dist/esm/core/shield.js +119 -0
- package/dist/esm/core/state.d.ts +5 -1
- package/dist/esm/core/state.js +3 -1
- package/dist/esm/core/storage.d.ts +7 -0
- package/dist/esm/core/storage.js +28 -8
- package/dist/esm/core/stylesheet.js +1 -1
- package/dist/esm/core/transport.d.ts +15 -4
- package/dist/esm/core/transport.js +64 -16
- package/dist/esm/core/utils.js +1 -1
- package/dist/esm/core/validate.js +6 -5
- package/dist/esm/device/appversion.js +1 -1
- package/dist/esm/device/index.js +67 -19
- package/dist/esm/engagement/api-rules.js +1 -1
- package/dist/esm/engagement/auto-api.js +4 -3
- package/dist/esm/engagement/auto-screen.js +10 -6
- package/dist/esm/engagement/defined-events.d.ts +2 -3
- package/dist/esm/engagement/defined-events.js +10 -16
- package/dist/esm/engagement/send.js +1 -1
- package/dist/esm/engagement/session.js +77 -37
- package/dist/esm/engagement/track.js +9 -6
- package/dist/esm/errors/send.js +1 -1
- package/dist/esm/errors/track.js +3 -2
- package/dist/esm/feedback/controls.d.ts +30 -4
- package/dist/esm/feedback/controls.js +234 -52
- package/dist/esm/feedback/i18n/index.d.ts +31 -0
- package/dist/esm/feedback/i18n/index.js +178 -0
- package/dist/esm/feedback/i18n/strings.d.ts +9 -0
- package/dist/esm/feedback/i18n/strings.js +4 -0
- package/dist/esm/feedback/index.js +1 -1
- package/dist/esm/feedback/logs.js +5 -4
- package/dist/esm/feedback/quartz.js +5 -2
- package/dist/esm/feedback/send.d.ts +4 -1
- package/dist/esm/feedback/send.js +56 -16
- package/dist/esm/feedback/styles.js +2 -2
- package/dist/esm/feedback/template.d.ts +4 -2
- package/dist/esm/feedback/template.js +67 -46
- package/dist/esm/feedback/ui.d.ts +40 -4
- package/dist/esm/feedback/ui.js +210 -91
- package/dist/esm/heatmap/send.js +1 -1
- package/dist/esm/heatmap/track.js +13 -9
- package/dist/esm/index.js +2 -2
- package/dist/esm/lifecycle.js +120 -73
- package/dist/esm/pushnotification/display.d.ts +65 -0
- package/dist/esm/pushnotification/display.js +95 -0
- package/dist/esm/pushnotification/index.d.ts +20 -0
- package/dist/esm/pushnotification/index.js +91 -0
- package/dist/esm/pushnotification/kept-opens.d.ts +23 -0
- package/dist/esm/pushnotification/kept-opens.js +62 -0
- package/dist/esm/pushnotification/notify.d.ts +45 -0
- package/dist/esm/pushnotification/notify.js +469 -0
- package/dist/esm/pushnotification/payload.d.ts +65 -0
- package/dist/esm/pushnotification/payload.js +272 -0
- package/dist/esm/pushnotification/session.d.ts +46 -0
- package/dist/esm/pushnotification/session.js +402 -0
- package/dist/esm/pushnotification/stats.d.ts +45 -0
- package/dist/esm/pushnotification/stats.js +238 -0
- package/dist/esm/pushnotification/wms.d.ts +30 -0
- package/dist/esm/pushnotification/wms.js +368 -0
- package/dist/esm/remoteconfig/country.js +1 -1
- package/dist/esm/remoteconfig/custom.js +4 -3
- package/dist/esm/remoteconfig/evaluate.js +1 -1
- package/dist/esm/remoteconfig/fetch.js +27 -8
- package/dist/esm/remoteconfig/index.d.ts +1 -6
- package/dist/esm/remoteconfig/index.js +4 -28
- package/dist/esm/remoteconfig/store.js +1 -1
- package/dist/esm/remoteconfig/tz-countries.js +1 -1
- package/dist/esm/remotelog/callsite.js +1 -1
- package/dist/esm/remotelog/gate.js +1 -1
- package/dist/esm/remotelog/logger.js +1 -1
- package/dist/esm/remotelog/send.js +5 -4
- package/dist/esm/remotelogger/index.js +1 -1
- package/dist/esm/scheduler.js +11 -5
- package/dist/esm/sw/apptics-pn-sw.d.ts +83 -0
- package/dist/esm/sw/timers.d.ts +44 -0
- package/dist/esm/types.d.ts +31 -15
- package/dist/esm/user/index.d.ts +7 -0
- package/dist/esm/user/index.js +26 -9
- package/dist/feedback.esm.min.js +2 -2
- package/dist/feedback.esm.min.js.map +1 -1
- package/dist/pushnotification.esm.min.js +3 -0
- package/dist/pushnotification.esm.min.js.map +1 -0
- package/dist/remoteconfig.esm.min.js +2 -2
- package/dist/remoteconfig.esm.min.js.map +1 -1
- package/dist/remotelogger.esm.min.js +2 -2
- package/dist/remotelogger.esm.min.js.map +1 -1
- package/package.json +15 -2
- package/dist/chunks/lifecycle-C6m1W7jo.min.js +0 -3
- package/dist/chunks/lifecycle-C6m1W7jo.min.js.map +0 -1
- package/dist/chunks/send-CgUO82ne.min.js +0 -3
- package/dist/chunks/send-CgUO82ne.min.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
# Apptics JS SDK 2.0.0
|
|
4
|
+
The first stable 2.0 release, published under the `latest` npm tag, with everything from the 2.0.0 betas. **New: web push notifications**, `AppticsPushNotification`. **New: anonymous tracking.** **New: the feedback form's new look, in 21 languages.** **Breaking: the tracking status is a name, not a number. Breaking: `AppticsUser.setUser` no longer changes the tracking status. Breaking: `AppticsRemoteConfig.fetchValue` is removed. Breaking: the defined events are browser events. Breaking: debug mode is switched from the browser console only.**
|
|
5
|
+
|
|
6
|
+
## Web push notifications
|
|
7
|
+
- When push is on for the app in the Apptics console, the SDK registers the browser and receives messages while a tab of the site is open. On a site outside Zoho's domains no routing or proxy is needed; a strict Content-Security-Policy must allow the Apptics host of your data centre in `frame-src`.
|
|
8
|
+
- `AppticsPushNotification.setEnabled(true)` and `setEnabled(false)` switch it on demand; `setEnabled(false)` holds across visits. `isEnabled()` tells the state. With `NO_TRACKING`, nothing is registered.
|
|
9
|
+
- `AppticsPushNotification.requestPermission()` asks for notification permission; the SDK never asks on its own. With permission, each message shows as a browser notification: title, text, icon, image, auto-dismiss, stay-on-screen and silent. A click opens the message's click action URL.
|
|
10
|
+
- A page that already uses Zoho WMS keeps its own handlers.
|
|
11
|
+
- Add `/apptics-pn-sw.js` to the site, holding `importScripts('https://static.zohocdn.com/apptics-js-sdk/2.0.0/apptics-pn-sw.js')`, for action buttons, the image carousel, the countdown and clicks after the tab has closed. Without it, notifications are plain. A site whose own service worker already controls its root keeps it.
|
|
12
|
+
- Received, opened and conversion stats are sent once per message per browser.
|
|
13
|
+
|
|
14
|
+
## Anonymous tracking
|
|
15
|
+
- New status `AppticsSettings.AP_TRACKING_STATUS.ANONYMOUS`, set with `AppticsSettings.setTrackingStatus(AppticsSettings.AP_TRACKING_STATUS.ANONYMOUS)`. Data is then tracked by an anonymous id, with no user on it. It is kept across visits, like the other statuses.
|
|
16
|
+
|
|
17
|
+
## The tracking status is a name
|
|
18
|
+
- Breaking: each `AP_TRACKING_STATUS` value is its own name (`AP_TRACKING_STATUS.ANONYMOUS === 'ANONYMOUS'`), and `AppticsSettings.getTrackingStatus()` returns one: `'USAGE_TRACKING_WITH_PII'`, `'USAGE_TRACKING_WITHOUT_PII'`, `'ANONYMOUS'` or `'NO_TRACKING'`. Code that compared it with a number compares with `AP_TRACKING_STATUS.<name>` now.
|
|
19
|
+
- A value that is no status is ignored, with a console warning. A status chosen under an earlier version is kept.
|
|
20
|
+
|
|
21
|
+
## setUser leaves the tracking status alone
|
|
22
|
+
- Breaking: a successful `AppticsUser.setUser` used to switch the status to `USAGE_TRACKING_WITH_PII`. It now registers the user and changes nothing else; only `setTrackingStatus` changes the status. To attribute data to the user, call `AppticsSettings.setTrackingStatus(AppticsSettings.AP_TRACKING_STATUS.USAGE_TRACKING_WITH_PII)`.
|
|
23
|
+
- A visitor on `NO_TRACKING` is still not registered by `setUser`.
|
|
24
|
+
|
|
25
|
+
## Remote config: fetchValues only
|
|
26
|
+
- Breaking: `AppticsRemoteConfig.fetchValue(name)` is removed. Read one parameter with `fetchValues([name])`: `const { bannerText } = await AppticsRemoteConfig.fetchValues(['bannerText'])`. The callback and `coldFetch` work as before.
|
|
27
|
+
|
|
28
|
+
## Defined events for the browser
|
|
29
|
+
- Breaking: `AppticsEvent.DefinedEvents` lists browser events now: page life cycle (`AP_PAGE_LOAD`, `AP_PAGE_VISIBLE`, `AP_PAGE_HIDDEN`, `AP_PAGE_UNLOAD`, `AP_PAGE_PRINT`), installed web app, sharing, downloads, notification permission, online and offline, language and full screen, and `AP_BROWSER`. The mobile-only events (app install and foreground, deep links, battery, orientation, OS) are removed. `AP_USER_SIGNUP`, `AP_USER_LOGIN`, `AP_USER_LOGOUT`, `AP_SEARCH`, the notification and theme events keep their names. They are still logged only when you call `addEvent`.
|
|
30
|
+
|
|
31
|
+
## The feedback form's new look, in 21 languages
|
|
32
|
+
- The form follows the Apptics web console's design, in light and dark. The `--zasdk-*` CSS variables still apply and element ids stay, apart from `#zasdkattachinfo`.
|
|
33
|
+
- Breaking for pages that style the form's insides: the markup is new, and `#zasdkattachinfo` and the `.zaleftcharcnt` and `.zasdk-btncnt` classes are gone.
|
|
34
|
+
- English, Čeština, Dansk, Deutsch, Español (España, México), Français (Canada, France), Bahasa Indonesia, Italiano, 日本語, 한국어, Nederlands, Polski, Português (Brasil, Portugal), Русский, Svenska, Türkçe, 中文简体 and 中文繁體. The form opens in the browser's language, else English, and a dropdown in the form switches it; the choice is remembered in that browser.
|
|
35
|
+
|
|
36
|
+
## Debug mode from the browser console only
|
|
37
|
+
- Breaking: `Apptics.enableDebug()` and `Apptics.disableDebug()` work only when typed in the browser's developer console; a call from the page's code is ignored, with a console warning.
|
|
38
|
+
- Breaking: `debug` (and `debug_api`) are no longer init options, and are ignored with a console warning.
|
|
39
|
+
|
|
40
|
+
## Fixes
|
|
41
|
+
- The SDK's own failures, and errors from its own script, feedback form and screen recorder, are no longer recorded as the app's JS errors.
|
|
42
|
+
- Opening the feedback form no longer records a JS error.
|
|
43
|
+
- A session now ends when the user leaves, even after a tab of the site was reloaded or closed.
|
|
44
|
+
- Event, screen and error properties: `true` and `false` arrive as Boolean; they arrived as the numbers `1` and `0`.
|
|
45
|
+
- The feedback form's file picker offers `.png`, `.jpg`, `.jpeg`, `.gif` and `.svg`; it offered `.txt`, which failed the feedback.
|
|
46
|
+
- After a new `appversion`, calls carry the new version correctly.
|
|
47
|
+
- While remote config can't be fetched, `fetchValues` no longer sends a request on every call.
|
|
48
|
+
- A push message whose text or URLs contain `-` is shown; it was dropped.
|
|
49
|
+
|
|
3
50
|
# Apptics JS SDK 2.0.0-beta.2
|
|
4
51
|
Published under the `beta` npm tag; `latest` stays on 1.0.2. **Fixes heatmaps for npm apps**: with 2.0.0-beta.1 from npm, heatmap records were captured but never sent. **Breaking: an event's group is required.** **New: every automatic tracker switched the same way: a config key and a `set…Tracking()` call, and each kind of engagement follows its own switch in the Apptics console.**
|
|
5
52
|
|