@zoho_apptics/apptics-js-sdk 2.0.0-beta → 2.0.0-beta.2
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 +191 -21
- package/README.md +519 -333
- 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/lifecycle-C6m1W7jo.min.js +3 -0
- package/dist/chunks/lifecycle-C6m1W7jo.min.js.map +1 -0
- package/dist/chunks/send-CgUO82ne.min.js +3 -0
- package/dist/chunks/send-CgUO82ne.min.js.map +1 -0
- package/dist/cjs/core/attempts.js +1 -1
- package/dist/cjs/core/batch.js +2 -2
- package/dist/cjs/core/consent.d.ts +18 -4
- package/dist/cjs/core/consent.js +31 -15
- package/dist/cjs/core/constants.d.ts +57 -27
- package/dist/cjs/core/constants.js +52 -33
- package/dist/cjs/core/db.d.ts +12 -4
- package/dist/cjs/core/db.js +167 -34
- package/dist/cjs/core/debug.js +1 -1
- package/dist/cjs/core/env.d.ts +0 -3
- package/dist/cjs/core/env.js +1 -9
- package/dist/cjs/core/framework-id.d.ts +1 -1
- package/dist/cjs/core/framework-id.js +3 -3
- package/dist/cjs/core/guard.d.ts +9 -0
- package/dist/cjs/core/guard.js +27 -13
- package/dist/cjs/core/hooks.d.ts +7 -4
- package/dist/cjs/core/hooks.js +3 -3
- package/dist/cjs/core/locks.d.ts +9 -0
- package/dist/cjs/core/locks.js +22 -0
- package/dist/cjs/core/logger.d.ts +3 -4
- package/dist/cjs/core/logger.js +4 -40
- package/dist/cjs/core/state.d.ts +9 -6
- package/dist/cjs/core/state.js +3 -5
- package/dist/cjs/core/storage.d.ts +20 -5
- package/dist/cjs/core/storage.js +115 -20
- package/dist/cjs/core/stylesheet.d.ts +8 -0
- package/dist/cjs/core/stylesheet.js +29 -0
- package/dist/cjs/core/transport.d.ts +2 -0
- package/dist/cjs/core/transport.js +30 -18
- package/dist/cjs/core/utils.js +1 -1
- package/dist/cjs/core/validate.js +2 -2
- package/dist/cjs/device/appversion.d.ts +10 -6
- package/dist/cjs/device/appversion.js +38 -3
- package/dist/cjs/device/index.d.ts +28 -2
- package/dist/cjs/device/index.js +312 -44
- package/dist/cjs/engagement/api-rules.d.ts +32 -67
- package/dist/cjs/engagement/api-rules.js +144 -157
- package/dist/cjs/engagement/auto-api.js +2 -2
- package/dist/cjs/engagement/auto-screen.d.ts +2 -0
- package/dist/cjs/engagement/auto-screen.js +67 -3
- package/dist/cjs/engagement/defined-events.js +1 -1
- package/dist/cjs/engagement/send.js +12 -3
- package/dist/cjs/engagement/session.d.ts +29 -3
- package/dist/cjs/engagement/session.js +253 -26
- package/dist/cjs/engagement/track.d.ts +4 -4
- package/dist/cjs/engagement/track.js +58 -30
- package/dist/cjs/errors/send.js +2 -2
- package/dist/cjs/errors/track.d.ts +2 -1
- package/dist/cjs/errors/track.js +49 -7
- package/dist/cjs/feedback/controls.d.ts +12 -0
- package/dist/cjs/feedback/controls.js +104 -25
- package/dist/cjs/feedback/index.d.ts +8 -7
- package/dist/cjs/feedback/index.js +32 -13
- package/dist/cjs/feedback/logs.d.ts +13 -11
- package/dist/cjs/feedback/logs.js +57 -28
- package/dist/cjs/feedback/quartz.d.ts +18 -0
- package/dist/cjs/feedback/quartz.js +105 -0
- package/dist/cjs/feedback/send.d.ts +5 -2
- package/dist/cjs/feedback/send.js +30 -28
- package/dist/cjs/feedback/styles.d.ts +10 -0
- package/dist/cjs/feedback/styles.js +8 -0
- package/dist/cjs/feedback/template.d.ts +1 -1
- package/dist/cjs/feedback/template.js +20 -12
- package/dist/cjs/feedback/ui.d.ts +21 -6
- package/dist/cjs/feedback/ui.js +283 -70
- package/dist/cjs/heatmap/send.d.ts +2 -0
- package/dist/cjs/heatmap/send.js +3 -5
- package/dist/cjs/heatmap/track.d.ts +1 -1
- package/dist/cjs/heatmap/track.js +87 -16
- package/dist/cjs/index.d.ts +16 -63
- package/dist/cjs/index.js +144 -95
- package/dist/cjs/lifecycle.d.ts +21 -3
- package/dist/cjs/lifecycle.js +353 -89
- package/dist/cjs/remoteconfig/country.d.ts +4 -0
- package/dist/cjs/remoteconfig/country.js +73 -0
- package/dist/cjs/remoteconfig/custom.d.ts +7 -7
- package/dist/cjs/remoteconfig/custom.js +31 -51
- package/dist/cjs/remoteconfig/evaluate.d.ts +3 -3
- package/dist/cjs/remoteconfig/evaluate.js +56 -43
- package/dist/cjs/remoteconfig/fetch.d.ts +16 -9
- package/dist/cjs/remoteconfig/fetch.js +120 -39
- package/dist/cjs/remoteconfig/index.d.ts +19 -8
- package/dist/cjs/remoteconfig/index.js +81 -39
- package/dist/cjs/remoteconfig/store.d.ts +15 -7
- package/dist/cjs/remoteconfig/store.js +68 -35
- package/dist/cjs/remoteconfig/tz-countries.d.ts +8 -0
- package/dist/cjs/remoteconfig/tz-countries.js +13 -0
- package/dist/{esm/core → cjs/remotelog}/callsite.d.ts +11 -4
- package/dist/cjs/{core → remotelog}/callsite.js +30 -7
- package/dist/cjs/remotelog/gate.d.ts +2 -11
- package/dist/cjs/remotelog/gate.js +9 -35
- package/dist/cjs/remotelog/index.d.ts +4 -21
- package/dist/cjs/remotelog/logger.d.ts +11 -17
- package/dist/cjs/remotelog/logger.js +31 -59
- package/dist/cjs/remotelog/send.js +11 -11
- package/dist/cjs/remotelogger/index.d.ts +12 -0
- package/dist/cjs/remotelogger/index.js +18 -0
- package/dist/cjs/scheduler.d.ts +3 -1
- package/dist/cjs/scheduler.js +25 -22
- package/dist/cjs/types.d.ts +208 -90
- package/dist/cjs/user/index.js +16 -7
- package/dist/esm/core/attempts.js +1 -1
- package/dist/esm/core/batch.js +2 -2
- package/dist/esm/core/consent.d.ts +18 -4
- package/dist/esm/core/consent.js +32 -17
- package/dist/esm/core/constants.d.ts +57 -27
- package/dist/esm/core/constants.js +51 -33
- package/dist/esm/core/db.d.ts +12 -4
- package/dist/esm/core/db.js +164 -35
- package/dist/esm/core/debug.js +1 -1
- package/dist/esm/core/env.d.ts +0 -3
- package/dist/esm/core/env.js +2 -9
- package/dist/esm/core/framework-id.d.ts +1 -1
- package/dist/esm/core/framework-id.js +3 -3
- package/dist/esm/core/guard.d.ts +9 -0
- package/dist/esm/core/guard.js +27 -14
- package/dist/esm/core/hooks.d.ts +7 -4
- package/dist/esm/core/hooks.js +3 -3
- package/dist/esm/core/locks.d.ts +9 -0
- package/dist/esm/core/locks.js +20 -0
- package/dist/esm/core/logger.d.ts +3 -4
- package/dist/esm/core/logger.js +4 -40
- package/dist/esm/core/state.d.ts +9 -6
- package/dist/esm/core/state.js +3 -5
- package/dist/esm/core/storage.d.ts +20 -5
- package/dist/esm/core/storage.js +113 -21
- package/dist/esm/core/stylesheet.d.ts +8 -0
- package/dist/esm/core/stylesheet.js +27 -0
- package/dist/esm/core/transport.d.ts +2 -0
- package/dist/esm/core/transport.js +30 -19
- package/dist/esm/core/utils.js +1 -1
- package/dist/esm/core/validate.js +2 -2
- package/dist/esm/device/appversion.d.ts +10 -6
- package/dist/esm/device/appversion.js +37 -4
- package/dist/esm/device/index.d.ts +28 -2
- package/dist/esm/device/index.js +313 -49
- package/dist/esm/engagement/api-rules.d.ts +32 -67
- package/dist/esm/engagement/api-rules.js +143 -155
- package/dist/esm/engagement/auto-api.js +3 -3
- package/dist/esm/engagement/auto-screen.d.ts +2 -0
- package/dist/esm/engagement/auto-screen.js +67 -4
- package/dist/esm/engagement/defined-events.js +1 -1
- package/dist/esm/engagement/send.js +12 -3
- package/dist/esm/engagement/session.d.ts +29 -3
- package/dist/esm/engagement/session.js +251 -30
- package/dist/esm/engagement/track.d.ts +4 -4
- package/dist/esm/engagement/track.js +65 -37
- package/dist/esm/errors/send.js +2 -2
- package/dist/esm/errors/track.d.ts +2 -1
- package/dist/esm/errors/track.js +49 -7
- package/dist/esm/feedback/controls.d.ts +12 -0
- package/dist/esm/feedback/controls.js +103 -26
- package/dist/esm/feedback/index.d.ts +8 -7
- package/dist/esm/feedback/index.js +34 -13
- package/dist/esm/feedback/logs.d.ts +13 -11
- package/dist/esm/feedback/logs.js +59 -30
- package/dist/esm/feedback/quartz.d.ts +18 -0
- package/dist/esm/feedback/quartz.js +99 -0
- package/dist/esm/feedback/send.d.ts +5 -2
- package/dist/esm/feedback/send.js +31 -31
- package/dist/esm/feedback/styles.d.ts +10 -0
- package/dist/esm/feedback/styles.js +4 -0
- package/dist/esm/feedback/template.d.ts +1 -1
- package/dist/esm/feedback/template.js +20 -12
- package/dist/esm/feedback/ui.d.ts +21 -6
- package/dist/esm/feedback/ui.js +283 -71
- package/dist/esm/heatmap/send.d.ts +2 -0
- package/dist/esm/heatmap/send.js +3 -5
- package/dist/esm/heatmap/track.d.ts +1 -1
- package/dist/esm/heatmap/track.js +87 -16
- package/dist/esm/index.d.ts +16 -63
- package/dist/esm/index.js +148 -83
- package/dist/esm/lifecycle.d.ts +21 -3
- package/dist/esm/lifecycle.js +359 -98
- package/dist/esm/remoteconfig/country.d.ts +4 -0
- package/dist/esm/remoteconfig/country.js +70 -0
- package/dist/esm/remoteconfig/custom.d.ts +7 -7
- package/dist/esm/remoteconfig/custom.js +32 -52
- package/dist/esm/remoteconfig/evaluate.d.ts +3 -3
- package/dist/esm/remoteconfig/evaluate.js +57 -44
- package/dist/esm/remoteconfig/fetch.d.ts +16 -9
- package/dist/esm/remoteconfig/fetch.js +120 -39
- package/dist/esm/remoteconfig/index.d.ts +19 -8
- package/dist/esm/remoteconfig/index.js +82 -40
- package/dist/esm/remoteconfig/store.d.ts +15 -7
- package/dist/esm/remoteconfig/store.js +68 -36
- package/dist/esm/remoteconfig/tz-countries.d.ts +8 -0
- package/dist/esm/remoteconfig/tz-countries.js +11 -0
- package/dist/{cjs/core → esm/remotelog}/callsite.d.ts +11 -4
- package/dist/esm/{core → remotelog}/callsite.js +30 -8
- package/dist/esm/remotelog/gate.d.ts +2 -11
- package/dist/esm/remotelog/gate.js +10 -32
- package/dist/esm/remotelog/index.d.ts +4 -21
- package/dist/esm/remotelog/logger.d.ts +11 -17
- package/dist/esm/remotelog/logger.js +33 -61
- package/dist/esm/remotelog/send.js +13 -13
- package/dist/esm/remotelogger/index.d.ts +12 -0
- package/dist/esm/remotelogger/index.js +13 -0
- package/dist/esm/scheduler.d.ts +3 -1
- package/dist/esm/scheduler.js +26 -24
- package/dist/esm/types.d.ts +208 -90
- package/dist/esm/user/index.js +18 -8
- package/dist/feedback.esm.min.js +2 -2
- package/dist/feedback.esm.min.js.map +1 -1
- package/dist/remoteconfig.esm.min.js +3 -0
- package/dist/remoteconfig.esm.min.js.map +1 -0
- package/dist/remotelogger.esm.min.js +3 -0
- package/dist/remotelogger.esm.min.js.map +1 -0
- package/package.json +16 -17
- package/dist/chunks/batch-BU_mTpm1.min.js +0 -3
- package/dist/chunks/batch-BU_mTpm1.min.js.map +0 -1
- package/dist/chunks/logs-Bea5zUW_.min.js +0 -3
- package/dist/chunks/logs-Bea5zUW_.min.js.map +0 -1
- package/dist/cjs/auto-init.d.ts +0 -8
- package/dist/cjs/auto-init.js +0 -32
- package/dist/cjs/heatmap/index.d.ts +0 -16
- package/dist/cjs/heatmap/index.js +0 -22
- package/dist/cjs/remotelog/index.js +0 -55
- package/dist/esm/auto-init.d.ts +0 -8
- package/dist/esm/auto-init.js +0 -29
- package/dist/esm/heatmap/index.d.ts +0 -16
- package/dist/esm/heatmap/index.js +0 -17
- package/dist/esm/remotelog/index.js +0 -51
- package/dist/heatmap.esm.min.js +0 -3
- package/dist/heatmap.esm.min.js.map +0 -1
- package/dist/style.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,181 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
# Apptics JS SDK 2.0.0-beta.2
|
|
4
|
+
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
|
+
|
|
6
|
+
## Switching automatic tracking: a config key and a set…Tracking() call each
|
|
7
|
+
- New config keys: `track_error` (uncaught errors and unhandled rejections, on by default) and `track_click` (clicks on elements tagged `apeventaction`, on by default), beside `track_screen`, `track_api` and `track_heatmap`.
|
|
8
|
+
- New calls: `AppticsEvent.setClickTracking(enabled?)` and `AppticsScreen.setScreenTracking(enabled?)`.
|
|
9
|
+
- Renamed, so all five read the same: `AppticsApi.enableApiTracking` is `AppticsApi.setApiTracking`, `AppticsError.trackGlobalErrorHandler` is `AppticsError.setErrorTracking`, and `AppticsHeatmap.trackHeatmap` is `AppticsHeatmap.setHeatmapTracking`. The earlier names still work, with a console warning naming the call to use, once per page.
|
|
10
|
+
- Each call takes `true` or `false`, `true` when left out. The config key decides at start-up: a call made before `Apptics.init()` is replaced by it, and `Apptics.reset()` goes back to it. Before, `trackGlobalErrorHandler(false)` called before `Apptics.init()` stayed in force; now `track_error: false` is the way to start with it off.
|
|
11
|
+
- The calls the app makes itself (`addEvent`, `inScreen`, `trackError`, `startTrackApi`) record whichever way a switch is set.
|
|
12
|
+
|
|
13
|
+
## Each kind of engagement follows its own module in getsdkconfig
|
|
14
|
+
- Events (module 5), API calls (6), screens (10) and sessions (11) are each switched by their own module. 2.0.0-beta.1 read only sessions (11) and switched all four with it, so turning off one kind in the Apptics console stopped them all, and turning off events alone did nothing.
|
|
15
|
+
- A kind that is off is not recorded, and the console says so in debug mode. Items of that kind already queued stay until it is on again, or until they expire (`batch_request_timeout`, 7 days).
|
|
16
|
+
- With sessions off and events or screens on, events and screens are still recorded, each with its session's start time; only the session itself is not sent.
|
|
17
|
+
- Errors follow `js_error` (module 15), the web SDK's own. 2.0.0-beta.1 read `crash` (13), which belongs to the native SDKs.
|
|
18
|
+
- A module the server does not mention is on, as before. Settings stored by an earlier build, with one `engagementtracking` flag, still switch all four.
|
|
19
|
+
|
|
20
|
+
## An event's group is required
|
|
21
|
+
- Breaking: `AppticsEvent.addEvent(eventName, groupName, properties?)` needs a group. An event without one (left out, `''` or `null`) is not logged, and the console says so, debug or not: `AppticsEvent.addEvent: groupName is required for "<event>": addEvent(eventName, groupName, properties?)`, once per event name. 2.0.0-beta.1 filed it under `default`, a group the app never named.
|
|
22
|
+
- `addEvent(eventName, properties)`, with the properties in the group's place, is refused the same way.
|
|
23
|
+
- Click tracking: an element with `apeventaction` and no `apgroupaction` around it is not tracked, and the console says the group is missing. 2.0.0-beta.1 filed it under `default`.
|
|
24
|
+
- Defined events (`AppticsEvent.DefinedEvents.X`) bring their own group, as before. An invalid group is still refused, as before.
|
|
25
|
+
- TypeScript: `groupName` is required in `addEvent`'s types, so a call without it is a compile error.
|
|
26
|
+
|
|
27
|
+
## Heatmaps are sent from npm builds
|
|
28
|
+
- Fix: with the npm package, heatmap records were captured and stored but never sent, by the flush timer or by `Apptics.flush()`. The sender was wired up by a module imported only for its side effect, and since the package's `sideEffects` names only the CDN bundle, app bundlers (Vite, webpack, Rollup) left it out. The CDN `<script>` build was not affected. A test now bundles the main entry the way an app does and checks that the sender is kept.
|
|
29
|
+
|
|
30
|
+
## Sessions end when the user left
|
|
31
|
+
- When a tab goes inactive (hidden, minimised, or its window loses focus to another one), that moment is the session's `lastactivetime`. Focus moving into an iframe on the page does not count.
|
|
32
|
+
- Back within `inactiveduration` (30 minutes by default), the same session goes on.
|
|
33
|
+
- Not back by then, the session ends at `lastactivetime` and is sent straight away, rather than staying open until the user returns or the tab closes. Coming back later starts a new session.
|
|
34
|
+
- A tab closed while inactive ends its session at `lastactivetime`, not when it closed: the time it sat hidden is no longer session time. A tab closed while in use ends it then, as before.
|
|
35
|
+
- While another tab of the site is on the same session, a tab that goes inactive or closes only leaves it; the last one ends it.
|
|
36
|
+
|
|
37
|
+
## The server's settings (getsdkconfig) are read on the server's schedule
|
|
38
|
+
- Once per page load: after `device/add` on a first visit, after `app/addversion` on a returning one (2.0.0-beta.1 made a returning visit wait for the first timer tick).
|
|
39
|
+
- Then at the time the answer's `next_check_after` gives, instead of every `getupdates_interval`. `getupdates_interval` is the wait only when an answer gives no time.
|
|
40
|
+
- Coming back to the tab asks again only once that time has passed; switching tabs used to ask every time.
|
|
41
|
+
- A device registered again during a page load (new device details, or a new SDK build) no longer asks a second time.
|
|
42
|
+
|
|
43
|
+
## Remote config stays up to date by itself
|
|
44
|
+
- The first fetch of each page load sends `flagtime` 0 and gets the whole rule set, which replaces what was stored.
|
|
45
|
+
- After that the SDK asks every 3 minutes, and when the tab comes back after 15 seconds or more away, with `flagtime` set to the time of its last answered fetch. The server answers with only what changed, which is merged into the stored set by `paramid` and `conditionid`; parameters and conditions it does not resend are kept.
|
|
46
|
+
- The five-minute cache is removed: `fetchValue` and `fetchValues` answer from the values the polling keeps up to date, without a request of their own.
|
|
47
|
+
- **`coldFetch` is back**, as the last argument of `fetchValue(name, callback?, coldFetch?)` and `fetchValues(names?, callback?, coldFetch?)`, `false` by default; it may take the callback's place (`fetchValue(name, true)`, `fetchValues(true)`). `true` asks the server for the whole rule set now (`flagtime` 0), replaces the stored set with it and answers from it. At most three a minute; one past that answers from the values the page already has.
|
|
48
|
+
|
|
49
|
+
## Apptics.flush() sends at most once every 15 seconds
|
|
50
|
+
- `Apptics.flush()` called by an app, or from the browser console, sends at most once every 15 seconds. A call sooner than that sends nothing and resolves at once; what is stored goes with the next send. The SDK's own sends (the flush timer, page hide and close, back online) are not held to it.
|
|
51
|
+
|
|
52
|
+
## Stored data follows the app it belongs to
|
|
53
|
+
- A page that starts with a different `base_url`, `app_domain` or `auth_key` from the stored data's clears everything the SDK stored (settings and all five queues, unsent data included) before start-up, which then runs as on a first visit: `app/addversion`, `device/add` and the rest. 2.0.0-beta.1 compared only `base_url` and `app_domain`, and kept the heatmap, remote logger and feedback log queues.
|
|
54
|
+
- `app_version_info` keeps an 8-character fingerprint of `auth_key` (`zakhash`), not the key itself. Data stored by 2.0.0-beta.1, which has none, registers the app version again once and is not cleared.
|
|
55
|
+
- `Apptics.reset()` empties the heatmap, remote logger and feedback log queues too.
|
|
56
|
+
|
|
57
|
+
## The CDN build is served from static.zohocdn.com
|
|
58
|
+
- `https://static.zohocdn.com/apptics-js-sdk/{version}/apptics.min.js`, with `apptics.esm.min.js`, `feedback.esm.min.js`, `chunks/` and the source maps in the same folder. Each release has a folder of its own.
|
|
59
|
+
- Remote config and the remote logger have module files of their own, as on npm: `remoteconfig.esm.min.js` (`AppticsRemoteConfig`) and `remotelogger.esm.min.js` (`AppticsLogger`), beside `apptics.esm.min.js` and `feedback.esm.min.js`. A page imports only the ones it uses, and they share one copy of the SDK.
|
|
60
|
+
- `npm run build` also writes that layout to `cdn/{version}/`, and the build server (`npm run build:cdn`, which registers the version first) zips it as `{version}/…` with `dist-meta.json`.
|
|
61
|
+
|
|
62
|
+
## Fixes
|
|
63
|
+
- `device/add` sends `isanonrequired=false`. The web SDK has no anonymous mode, only the tracking statuses (with PII, without PII, none), which `devicestatus` carries; with the default status, usage tracking without PII, 2.0.0-beta.1 sent `true`.
|
|
64
|
+
- The device was registered again (`device/add`) on every page load when the server's answer carried no `anonymousid`, as sdk-apptics.zoho.in's does. A device with a `deviceid` counts as registered; `anonymousid` is optional.
|
|
65
|
+
- Start-up waits for stored data of another app to be cleared before calling `app/addversion`.
|
|
66
|
+
|
|
67
|
+
# Apptics JS SDK 2.0.0-beta.1
|
|
68
|
+
Published under the `beta` npm tag; `latest` stays on 1.0.2. **Breaking for 2.0.0-beta code**: the changes are listed below, each with what to use instead.
|
|
69
|
+
|
|
70
|
+
## The init() keys are base_url, auth_key and app_domain
|
|
71
|
+
- `Apptics.init({ base_url, auth_key, app_domain, appversion })`, in place of 2.0.0-beta's `serviceUrl`, `zak` and `identifier`.
|
|
72
|
+
- The earlier names still start the SDK, with a console warning naming the key to use: `serviceUrl` and 1.0.2's `base_domain` for `base_url`, `zak` and `token` for `auth_key`, `identifier` for `app_domain`. Data already stored in a browser is kept.
|
|
73
|
+
|
|
74
|
+
## Every call is on the object of its feature
|
|
75
|
+
Breaking for 2.0.0-beta code: each call keeps its name and moves onto the object of its feature, so an app imports only the objects.
|
|
76
|
+
|
|
77
|
+
| 2.0.0-beta | Now |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `ready()`, `flush()`, `reset()`, `enableDebug()`, `disableDebug()` | `Apptics.ready()`, `Apptics.flush()`, `Apptics.reset()`, `Apptics.enableDebug()`, `Apptics.disableDebug()` |
|
|
80
|
+
| `AppticsTrackError(event, props)`, `enableGlobalErrorHandler(on)` | `AppticsError.trackError(event, properties)`, `AppticsError.trackGlobalErrorHandler(on)` |
|
|
81
|
+
| `AppticsSetUser(userid, groupid, props)`, `getUser()`, `users.UserBuilder` | `AppticsUser.setUser(userid, groupid, props)`, `AppticsUser.getUser()`, `AppticsUser.UserBuilder` |
|
|
82
|
+
| `setTrackingStatus(status)`, `getTrackingStatus()` | `AppticsSettings.setTrackingStatus(status)`, `AppticsSettings.getTrackingStatus()` |
|
|
83
|
+
| `AppticsEvents.addEvent()` | `AppticsEvent.addEvent()` |
|
|
84
|
+
| `AppticsScreenTracker.inScreen()`, `outScreen()` | `AppticsScreen.inScreen()`, `outScreen()` |
|
|
85
|
+
| `AppticsApiTracker.startTrackApi()`, `endTrackApi()`, `configure()`, and `enableApiTracking(on)` | `AppticsApi.startTrackApi()`, `endTrackApi()`, `configure()`, `enableApiTracking(on)` |
|
|
86
|
+
| `AP_TRACKING_STATUS` | `AppticsSettings.AP_TRACKING_STATUS` |
|
|
87
|
+
| `AP_FEEDBACK_TYPE` | `AppticsFeedback.AP_FEEDBACK_TYPE` from `/feedback` |
|
|
88
|
+
| `DefinedEvents` | `AppticsEvent.DefinedEvents` |
|
|
89
|
+
| `ApiTrackingBuilder`, `UserBuilder` | `AppticsApi.ApiTrackingBuilder`, `AppticsUser.UserBuilder` |
|
|
90
|
+
| `addFeedbackLog()`, `addDiagnosticsInfo()` | `AppticsFeedback.addFeedbackLog()`, `AppticsFeedback.addDiagnosticsInfo()` from `/feedback` |
|
|
91
|
+
| `feedbackOpen(type, message, …)`, `feedbackClose()` from `/feedback` | `AppticsFeedback.feedbackFormOpen(options)`, `AppticsFeedback.feedbackFormClose()` from `/feedback` |
|
|
92
|
+
| `sendFeedback(type, message, …)` from `/feedback` | `AppticsFeedback.sendFeedback({ type, message, attachments, logFiles, includeDiagnostics, includeLog, isAnonymous })` |
|
|
93
|
+
| `enableHeatmap(on)` from `/heatmap` | `AppticsHeatmap.trackHeatmap(on)` from the main entry |
|
|
94
|
+
|
|
95
|
+
- `AppticsEvents` is `AppticsEvent`; `AppticsLogger` and `AppticsRemoteConfig` keep their names. The package exports only the objects: `DefinedEvents` is `AppticsEvent.DefinedEvents`, `ApiTrackingBuilder` is `AppticsApi.ApiTrackingBuilder`, and `UserBuilder` is `AppticsUser.UserBuilder`.
|
|
96
|
+
- The feedback form has a theme: `feedback_theme: 'light' | 'dark' | 'auto'` (default `auto`, the visitor's system setting), colors as `--zasdk-*` CSS variables a page can override, and the previously hard-coded colors of the user picker, toggles and data viewer now follow the theme. The form is a labelled modal dialog: it takes focus on open, Escape closes it, and the close control works from the keyboard. The textarea placeholder uses the page font, and the counter reads "characters left".
|
|
97
|
+
- `AppticsFeedback.setFeedbackTheme('light' | 'dark' | 'auto')` changes the theme after `Apptics.init()`, restyling a form that is open, for pages with their own theme switch: `auto` follows the operating system, not the page.
|
|
98
|
+
- The feedback form's System Logs viewer shows each time in the visitor's local zone (`16 Oct 2026, 11:53:48 PM IST`). The `feedbacklog.txt` sent with the report is unchanged: it keeps ISO 8601 UTC stamps.
|
|
99
|
+
- The feedback form lists Feedback first, then Bug, Help and Report, and opens with Feedback selected. The type values (`AP_FEEDBACK_TYPE`) are unchanged.
|
|
100
|
+
- `AppticsHeatmap` is on the main entry. There is no `/heatmap` entry or `heatmap.esm.min.js` any more.
|
|
101
|
+
- `AppticsLogger` is on its own entry point, `@zoho_apptics/apptics-js-sdk/remote-logger`, and the main entry has no `AppticsLogger`. The `<script>` build still defines it as a global.
|
|
102
|
+
- Every feedback call, `addFeedbackLog()` and `addDiagnosticsInfo()` included, is on the `/feedback` entry's `AppticsFeedback`. The main entry has no `AppticsFeedback`.
|
|
103
|
+
- The `<script>` build defines every object as a global: `Apptics`, `AppticsEvent`, `AppticsScreen`, `AppticsApi`, `AppticsError`, `AppticsUser`, `AppticsSettings`, `AppticsFeedback`, `AppticsLogger`, `AppticsRemoteConfig`, `AppticsHeatmap`. The `AppticsEvents`, `AppticsScreenTracker`, `AppticsApiTracker`, `AppticsTrackError` and `AppticsSetUser` globals are gone.
|
|
104
|
+
- The TypeScript type for the whole API, `AppticsApi` in 2.0.0-beta, is `AppticsSdk`: `AppticsApi` is the API-tracking object now.
|
|
105
|
+
|
|
106
|
+
## The feedback form brings its own styles
|
|
107
|
+
- `AppticsFeedback.feedbackFormOpen()` adds the form's stylesheet to the page the first time it opens, so npm apps no longer `import '@zoho_apptics/apptics-js-sdk/style.css'`. The CDN builds carry the styles too, so no app imports or links a css file, and `style.css` is no longer a published file.
|
|
108
|
+
|
|
109
|
+
## Screen recording is set up in the console
|
|
110
|
+
- `DC`, `quartz_workspace_key` and `quartz_department_key` are no longer `Apptics.init()` keys: the form takes its recording settings from `getsdkconfig` and loads the script it needs itself. `Apptics.init()` warns when it is still given them.
|
|
111
|
+
|
|
112
|
+
## The remote logger is the app's own lines, logged directly
|
|
113
|
+
- `AppticsLogger.verbose`, `debug`, `info`, `warn` and `error(message, properties?)`, in place of 2.0.0-beta's `v`, `d`, `i`, `w` and `e(tag, message)`. `properties` is appended to the message: an object as JSON, an `Error` as its stack.
|
|
114
|
+
- No switch: `AppticsLogger.enable()`, `disable()` and `isEnabled()` are removed, and a line is recorded as it is written (while the server has the remote logger on and tracking is allowed).
|
|
115
|
+
- The SDK no longer sends its own failures to the Remote Logger page: the `remote_log` option is removed, and `Apptics.init()` warns when it is still given it.
|
|
116
|
+
- Same levels, 1 to 5; the tag is gone, since the Remote Logger page does not use it.
|
|
117
|
+
- The `show_logs` option is removed: `AppticsLogger` lines go to the Remote Logger page only, and are not printed to the browser console. `Apptics.init()` warns when it is still given it.
|
|
118
|
+
|
|
119
|
+
## Remote config follows the console's condition order
|
|
120
|
+
- A parameter takes the value of the first condition, in the order of the console's `all_condition` list, that matches this device; none matches, its default value. 2.0.0-beta went by each parameter's `conditionorder`.
|
|
121
|
+
- **`setCustomConditionValue(conditionname, values)`**: a custom condition (`custom_sdk_value`) is answered by its condition name, with this device's values comma separated, and matches when one of them is listed. 2.0.0-beta took the criteria key. Values are for the page, no longer stored across visits.
|
|
122
|
+
- **`country`** criteria: the country `AppticsUser.setUser` registered, else the country of the browser's time zone (`Asia/Kolkata`, or Chrome's `Asia/Calcutta`: India), from a table generated from tzdata by `scripts/tz-countries.mjs`.
|
|
123
|
+
- `fetchValues(names?)` takes a list of parameter names, `fetchValues(['primaryColor', 'maxItems'])`, in place of 2.0.0-beta's `{ name: default }` object: each value's default comes from the console, and a name the console doesn't have is `null`. With no names it answers with every parameter.
|
|
124
|
+
- `AppticsRemoteConfig.setFallbackWithOfflineValue` is removed: a failed fetch answers with the values fetched before, as it did by default.
|
|
125
|
+
- `coldFetch` is removed from `fetchValue` and `fetchValues`: a fetch from the last five minutes answers later reads, and the SDK asks the server again once it is older.
|
|
126
|
+
|
|
127
|
+
## Feedback calls take one options object
|
|
128
|
+
- `AppticsFeedback.feedbackFormOpen({ type, message, includeLog, includeDiagnostics, attachments, logFiles, isAnonymous })` and `AppticsFeedback.sendFeedback({ type, message, attachments, logFiles, includeDiagnostics, includeLog, isAnonymous })`, in place of their long lists of arguments; every key is optional. `includeDyninfo` is `includeDiagnostics`.
|
|
129
|
+
- `sendFeedback` is sent from the user `AppticsUser.setUser` set, or from nobody with `isAnonymous: true`. It used to go from whoever the form's user picker last chose, which was nobody until the form had been opened.
|
|
130
|
+
- `feedbackOpen` and `feedbackClose` are `feedbackFormOpen` and `feedbackFormClose`.
|
|
131
|
+
- The old one-after-another form is answered safely: `feedbackFormOpen(type, …)` opens the form with its defaults and a warning, and `sendFeedback(type, …)` rejects rather than send an empty report.
|
|
132
|
+
- Feedback is sent even when tracking is off (`NO_TRACKING`): only the feedback goes.
|
|
133
|
+
|
|
134
|
+
## API tracking rules: equals and regex, to allow or to ignore
|
|
135
|
+
- `ApiTrackingBuilder` has four rules: `allowEquals`, `allowRegex`, `ignoreEquals` and `ignoreRegex`, each tried on the call's URL without its query. An ignore always wins; with allow rules, a call must match one.
|
|
136
|
+
- `ignoreDomains`, `allowOnlyDomains`, `allowOnlyTLDs`, `ignoreTLDs`, `ignoreDomainPrefixes`, `ignoreDomainSuffixes`, `groupDomains`, `ignoreEndpoint`, `addPattern`, `preserveSegments` and `autoDetection` are removed; calling one throws a `TypeError` naming what to use. Ids, UUIDs and tokens in a path still become `*` on their own.
|
|
137
|
+
- A call reported by its parts (a `hostname` and a `path`) is recorded with its own scheme and port, `https` and 443 unless given, not the page's.
|
|
138
|
+
|
|
139
|
+
## screen_routes takes exact paths and regular expressions
|
|
140
|
+
- Beside route patterns (`'/users/{id}/orders'`), `{ equals: '/', name: 'Home' }` and `{ regex: /^\/orders\/\d+$/, name: 'Order detail' }` name a path; entries are tried in order. An entry that cannot be used is left out, and said.
|
|
141
|
+
|
|
142
|
+
## Heatmaps: trackHeatmap
|
|
143
|
+
- `AppticsHeatmap.trackHeatmap(on?)` starts or stops capture.
|
|
144
|
+
|
|
145
|
+
## Sessions are always recorded
|
|
146
|
+
- The `track_session` option is removed: every event, screen and error belongs to a session, so there is no tracking without one. An app that wants nothing recorded uses `AppticsSettings.setTrackingStatus(AppticsSettings.AP_TRACKING_STATUS.NO_TRACKING)`. `Apptics.init()` warns when it is still given `track_session`.
|
|
147
|
+
|
|
148
|
+
## Storage is tidier
|
|
149
|
+
- IndexedDB's stores and keys are renamed: each record's order key `seq` is `queue`, the remote logger's store `consolelogs` is `remotelogs`, and the feedback store `logs` is `feedbacklogs`, whose entries are of type `feedbacklog` and `feedbackdiagnostics` (were `log` and `diagnostics`). The localStorage fallback's keys follow. A browser that ran 2.0.0-beta is moved over on its first load, with everything queued kept.
|
|
150
|
+
- The settings store no longer has `appkey`, `appversion`, `hadsession`, `token`, `tracking_status` or `uuid`: the app and its version are read from `app_version_info`, the tracking status is in `trackinfo`, and the uuid and `hadsession` are in `device_info`. They are moved there on the first load, so a browser stays the same device and keeps the visitor's choice. `user_info` holds the user `AppticsUser.setUser` registered.
|
|
151
|
+
|
|
152
|
+
## Fixes
|
|
153
|
+
- `AppticsFeedback.addDiagnosticsInfo(heading, key, value)` requires the value: an entry without one (or without a heading or key) is not recorded, and the console says why. It used to store an empty value silently.
|
|
154
|
+
- A `<script>`, `<img>` or `<link>` that fails to load is tracked as a JS error: its `error` event does not bubble, so it never reached the SDK's listener.
|
|
155
|
+
- One visit with Do Not Track on no longer switches tracking off for good: it was stored as the visitor's own choice, so tracking stayed off after Do Not Track was turned off or `ignore_do_not_track` set.
|
|
156
|
+
- A first visit with no network starts once the browser is back online, keeping what was tracked meanwhile; it used to give up for the rest of the page.
|
|
157
|
+
- Stored data waits for `device/add` to answer instead of going out without a `deviceid`.
|
|
158
|
+
- A scroll still settling when heatmaps are switched off (a single-page app leaving a heatmap page) is recorded, not dropped.
|
|
159
|
+
- `AppticsFeedback.sendFeedback()` refuses more than 5 attachments or more than 10 MB, as the form does; it used to send none of them while saying they were there.
|
|
160
|
+
- An invalid event, group or screen name is said in the console once, with console logging off too.
|
|
161
|
+
- A browser console showed every public call as `(...args)`. Each one now shows its own parameter names, as `addEvent(eventName, groupName, properties)`, in the npm and the minified CDN builds alike.
|
|
162
|
+
- A remote logger line typed in the browser's developer console is sent with function `-`, filename `-` and line 0, instead of the console's `<anonymous>` (Chrome, Edge), `code` (Firefox) or nothing (Safari).
|
|
163
|
+
- `getsdkconfig` is no longer called at start-up straight after `app/addversion`. It is called once `device/add` has succeeded, then every `getupdates_interval` (2 minutes by default) and when the page comes back into view; a returning visit starts from the settings the last one saved.
|
|
164
|
+
- Heatmap scroll records were never stored on pages that scroll a content pane rather than the window, as app layouts do: the gesture was measured on the window, which had not moved. The pane that scrolled is measured now, when it covers at least half the viewport each way, so a dropdown list scrolling is still not counted.
|
|
165
|
+
- Automatic screen tracking lost pages in Next.js and other routers that replaceState the same url right after a route change: the page was not recorded and the view before it was never ended.
|
|
166
|
+
- A screen view left open by a tab that reloaded, closed or crashed stayed open until the session ended. A tab now ends such views when it starts or comes back into view, at the time their tab was last seen (Web Locks; browsers without them end the views with their session, as before).
|
|
167
|
+
- A promise rejected with an `Event`, such as a failed script or image load, was reported as "[object Event]". It is named by the event and the element it came from; a rejection with a plain object by its JSON.
|
|
168
|
+
- Click tracking reads `data-apeventaction`, `data-apgroupaction` and `data-apeventprops` too, the spelling React and TypeScript accept without declaring the attributes.
|
|
169
|
+
- `getupdates` (remote config) no longer carries `userid` and `customergroupid` once a user is set; the server refused them as `EXTRA_PARAM_FOUND`. Conditions on the user are still applied, on the device.
|
|
170
|
+
- Two tabs opened together on a first visit registered the browser twice. Registration now runs under a lock shared by the site's tabs, and a tab finding another's registration in storage uses it.
|
|
171
|
+
- Tabs of a site share one session, and closing one of them no longer ends it for the others: the session ends when the last tab closes.
|
|
172
|
+
- A `base_url` on localzoho reports framework id 5970, the id localzoho issued for 2.0.0-beta, instead of the one issued by sdk-apptics.zoho.com, which localzoho refuses as `INVALID_FRAMEWORK`.
|
|
173
|
+
|
|
3
174
|
# Apptics JS SDK 2.0.0-beta
|
|
4
|
-
A rewrite of the web SDK in TypeScript, published on npm as ES modules, CommonJS and a minified browser build. Published under the `beta` npm tag; `latest` stays on 1.0.2. **`Apptics.init()` takes new config**: see "
|
|
175
|
+
A rewrite of the web SDK in TypeScript, published on npm as ES modules, CommonJS and a minified browser build. Published under the `beta` npm tag; `latest` stays on 1.0.2. **`Apptics.init()` takes new config**: see "Migrating from 1.0.2 to 2.0.0-beta.1" in the README. Runs in Chrome 80+, Edge 80+, Firefox 74+ and Safari 14+.
|
|
5
176
|
|
|
6
177
|
## Initialization
|
|
7
|
-
- **
|
|
178
|
+
- **New names**: `Apptics.init(config)`, `AppticsEvents.addEvent`, `AppticsScreenTracker.inScreen` / `outScreen`, `AppticsApiTracker.startTrackApi` / `endTrackApi` / `configure`, `AppticsLogger.enable` / `disable` / `isEnabled` / `v` / `d` / `i` / `w` / `e`, `AppticsTrackError`, `AppticsSetUser`, and `AppticsRemoteConfig`. The `<script>` build defines them as globals too. 1.0.2's `apptics.init`, `apptics.trackEvent`, `apptics.trackScreen`, `apptics.trackError` and `apptics.setUser` are gone, so code calling them has to be renamed.
|
|
8
179
|
- **New config**: `Apptics.init()` takes `serviceUrl`, `zak`, `identifier` and `appversion`, all required. The SDK gets `aaid`, the portal id and the project id from the server, so `aaid`, `zsoid` and `projectID` are no longer passed in. A missing key is named in a console warning and `Apptics.init()` returns `false`.
|
|
9
180
|
- **`appversion` is required**: 1.0.2 defaulted it to `1.0`, which attributed every session, error and crash to a version that was never shipped.
|
|
10
181
|
- **`appversion` takes a string or a number**: `'2.4.0'`, `'v2.4-build512'` or a build number such as `512`. It is sent as text: a string is trimmed, and a number keeps the digits JavaScript gives it (`1.10` is `'1.1'`), so pass a dotted version as a string. A blank value, or a snippet placeholder (`YOUR_APP_VERSION`, `YOUR_BUILD_OR_APP_VERSION`, `YOUR_APPVERSION`), is refused with a console warning and `Apptics.init()` returns `false`.
|
|
@@ -20,37 +191,37 @@ A rewrite of the web SDK in TypeScript, published on npm as ES modules, CommonJS
|
|
|
20
191
|
- **License**: the Zoho Apptics JavaScript SDK license (see LICENSE) instead of MIT. It allows installing from npm or a CDN, bundling with your build tools and serving the SDK to your users as part of your web app.
|
|
21
192
|
|
|
22
193
|
## Events
|
|
23
|
-
- **Defined events
|
|
194
|
+
- **Defined events**: `AppticsEvents.addEvent(DefinedEvents.AP_USER_LOGIN, props?)` logs Apptics' ready-made events under their own `AP_` groups.
|
|
24
195
|
- **`ap_` / `AP_` is reserved**: an app's event, group or property key starting with it is not logged.
|
|
25
|
-
- **An event with an invalid group is not logged**,
|
|
196
|
+
- **An event with an invalid group is not logged**, instead of being filed under `default`; an event with no group is still `default`.
|
|
26
197
|
- **Properties are judged one by one**: a bad key or an over-long value drops that property, and the event keeps the rest (it used to lose them all). Booleans are typed as Boolean and every number as Number (`1` and `0` were typed as Boolean); objects and arrays are sent as JSON text.
|
|
27
198
|
|
|
28
199
|
## Sessions
|
|
29
|
-
- **`track_session: false`** turns automatic sessions off
|
|
200
|
+
- **`track_session: false`** turns automatic sessions off; events and screens are still recorded.
|
|
30
201
|
|
|
31
202
|
## Screen Tracking
|
|
32
|
-
- **`trackScreen()` is renamed `AppticsScreenTracker.inScreen()
|
|
33
|
-
- **Screen views have a duration.** A view ends when the next screen starts, when the page is hidden (coming back starts a new view), or when its session ends. `AppticsScreenTracker.inScreen()` now returns the view's id, and `AppticsScreenTracker.outScreen(id)` ends it yourself
|
|
34
|
-
- **Automatic screen tracking, on by default**: the first page and every navigation (`pushState`, `replaceState`, back and forward, `#/` hash routes) are recorded as screens, named by the path without its query string. A `AppticsScreenTracker.inScreen()` from the router names a route your own way. A `AppticsScreenTracker.inScreen()` call within 300 ms of a navigation
|
|
203
|
+
- **`trackScreen()` is renamed `AppticsScreenTracker.inScreen()`**: same arguments, and it returns the view's id for `AppticsScreenTracker.outScreen(id)`. `trackScreen` no longer exists, so 1.0.2 code calling it has to be renamed.
|
|
204
|
+
- **Screen views have a duration.** A view ends when the next screen starts, when the page is hidden (coming back starts a new view), or when its session ends. `AppticsScreenTracker.inScreen()` now returns the view's id, and `AppticsScreenTracker.outScreen(id)` ends it yourself. Until now every view was recorded with no time spent.
|
|
205
|
+
- **Automatic screen tracking, on by default**: the first page and every navigation (`pushState`, `replaceState`, back and forward, `#/` hash routes) are recorded as screens, named by the path without its query string. A `AppticsScreenTracker.inScreen()` from the router names a route your own way. A `AppticsScreenTracker.inScreen()` call within 300 ms of a navigation (from a router hook) replaces the automatic view, so the navigation counts once under the app's name; `track_screen: false` turns automatic tracking off.
|
|
35
206
|
- **`setScreenName()` is removed.** Records are attributed to the screen `AppticsScreenTracker.inScreen()` or automatic tracking last named; heatmap records with neither get the page's name, made from its path the same way.
|
|
36
207
|
|
|
37
208
|
## Remote Logger
|
|
38
|
-
- **`AppticsLogger`**: `AppticsLogger.v/d/i/w/e(tag, message, ...details)` sends the app's log lines to the Remote Logger page, as levels 1 to 5
|
|
39
|
-
- **
|
|
40
|
-
- **`show_logs: true`** prints the app's lines to the browser console as well
|
|
41
|
-
- **Offline storage is capped at 1 MB**, oldest lines dropped first
|
|
209
|
+
- **`AppticsLogger`**: `AppticsLogger.v/d/i/w/e(tag, message, ...details)` sends the app's log lines to the Remote Logger page, as levels 1 to 5. Off until `AppticsLogger.enable()`; `AppticsLogger` in the `<script>` build. Each line carries the time it was logged and the function, file and line that logged it.
|
|
210
|
+
- **Tagged lines**: `AppticsLogger.v/d/i/w/e(tag, message)`, with the tag leading the message as `[tag]`, and `AppticsLogger.disable()`.
|
|
211
|
+
- **`show_logs: true`** prints the app's lines to the browser console as well.
|
|
212
|
+
- **Offline storage is capped at 1 MB**, oldest lines dropped first (instead of 200 lines).
|
|
42
213
|
- **SDK diagnostics**: the SDK reports its own failures to the same page, tagged with the module it happened in. Off by default; `remote_log: true` turns it on, independently of `AppticsLogger`.
|
|
43
214
|
|
|
44
215
|
## API Tracking
|
|
45
|
-
- **Path normalization
|
|
46
|
-
- **`AppticsApiTracker.configure(new ApiTrackingBuilder()...build())`** with
|
|
47
|
-
- **`AppticsApiTracker.startTrackApi(url, method)` / `AppticsApiTracker.endTrackApi(id, code)`** time and record a call
|
|
216
|
+
- **Path normalization**: numeric ids, UUIDs and JWTs in a path become `*`, and the query string is removed, so calls group by endpoint (`/users/42/orders` → `/users/*/orders`).
|
|
217
|
+
- **`AppticsApiTracker.configure(new ApiTrackingBuilder()...build())`** with rules: `ignoreDomains`, `allowOnlyDomains`, `allowOnlyTLDs`, `ignoreTLDs`, `ignoreDomainPrefixes`, `ignoreDomainSuffixes`, `groupDomains`, `ignoreEndpoint`, `addPattern`, `preserveSegments`, `autoDetection`. They apply to every call.
|
|
218
|
+
- **`AppticsApiTracker.startTrackApi(url, method)` / `AppticsApiTracker.endTrackApi(id, code)`** time and record a call.
|
|
48
219
|
- **`track_api: true`** records every `fetch` and XHR call automatically (`enableApiTracking(on)` switches it later); a call is reported by hand with `AppticsApiTracker.startTrackApi` / `endTrackApi`. The SDK's own requests are never recorded. Host rules are set only through `AppticsApiTracker.configure`: the earlier `track_api_hosts` / `track_api_exclude_hosts` keys are gone, and `Apptics.init()` warns when it is given them.
|
|
49
220
|
|
|
50
221
|
## Remote Config
|
|
51
|
-
- **`AppticsRemoteConfig`** from `@zoho_apptics/apptics-js-sdk/remote-config` (`AppticsRemoteConfig` in the `<script>` build): four calls
|
|
52
|
-
- **`setCustomConditionValue(key, value)
|
|
53
|
-
- **`fetchValue(name)`** and **`fetchValues({ name: default })
|
|
222
|
+
- **`AppticsRemoteConfig`** from `@zoho_apptics/apptics-js-sdk/remote-config` (`AppticsRemoteConfig` in the `<script>` build): four calls: `fetchValue(name)` and `fetchValues({ name: default })` read parameters, `setCustomConditionValue` and `setFallbackWithOfflineValue` (below). The rule set is stored and resolved on the device, and conditions on the user re-apply on their own after `AppticsSetUser`.
|
|
223
|
+
- **`setCustomConditionValue(key, value)`**: conditions on a custom criteria match this device's value. Kept across visits; works before `Apptics.init()`.
|
|
224
|
+
- **`fetchValue(name)`** and **`fetchValues({ name: default })`**: Promises, with an optional callback. A parameter the console doesn't have is `null`.
|
|
54
225
|
- **Fetched on start-up**, so values are this session's without the app asking.
|
|
55
226
|
- **A fetch from the last five minutes is reused**; `coldFetch` asks the server regardless, at most three times a minute.
|
|
56
227
|
- **`setFallbackWithOfflineValue(false)`**: a failed fetch answers with `null` and defaults instead of the values fetched before (the default).
|
|
@@ -61,12 +232,11 @@ A rewrite of the web SDK in TypeScript, published on npm as ES modules, CommonJS
|
|
|
61
232
|
|
|
62
233
|
## Debugging
|
|
63
234
|
- **Debug mode**: `debug: true` in `Apptics.init()`, or `enableDebug()` / `disableDebug()` at any time, with or without `Apptics.init()`. Payloads go to the debug endpoints, for following in the Apptics web console. What the app sets with the functions wins over the `Apptics.init()` option; debug mode switches itself off after an hour with nothing tracked.
|
|
64
|
-
- **`debug` now means debug mode.**
|
|
235
|
+
- **`debug` now means debug mode.** In 1.0.2 it turned on browser-console logging.
|
|
65
236
|
|
|
66
237
|
## Feedback
|
|
67
238
|
- **`sendFeedback()`** returns a Promise that resolves once the feedback is sent and rejects when it wasn't (SDK not started, offline, server refusal). It takes `includeLog` as a sixth argument; `includeLog` and `includeDyninfo` send their file when there is something stored, unless set to `false`.
|
|
68
239
|
- `addFeedbackLog()` and `addDiagnosticsInfo()` are on the main entry point, so recording context doesn't pull the form into a bundle. `dyninfo.txt` carries the diagnostics and a `[Device Info]` block. Stored entries are capped at 1,000, and 10,000 characters per message.
|
|
69
|
-
- The form works without the Quartz script; the screen-recording option is hidden instead.
|
|
70
240
|
|
|
71
241
|
## Server APIs
|
|
72
242
|
- Every call goes to the v2 APIs. Logs are sent in batches, and the server's per-module settings (`getsdkconfig`) are honoured: a module the server switches off stops recording and sending.
|
|
@@ -78,7 +248,7 @@ A rewrite of the web SDK in TypeScript, published on npm as ES modules, CommonJS
|
|
|
78
248
|
- The server's "stop tracking" signal was ignored.
|
|
79
249
|
- `ignore_do_not_track: true` disabled tracking instead of ignoring the browser's Do Not Track setting.
|
|
80
250
|
- Click tracking with `apeventaction` required jQuery.
|
|
81
|
-
- The
|
|
251
|
+
- The SDK crashed without `screen.orientation`.
|
|
82
252
|
- Send timers multiplied on every reconnect; devices were registered twice; the device update on an app-version change was sent empty.
|
|
83
253
|
- A successful error send wiped errors recorded while it was in flight.
|
|
84
254
|
- Requests now time out after 30 seconds, and ids in request URLs are encoded.
|