@zoho_apptics/apptics-js-sdk 1.0.2 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +193 -0
- package/LICENSE +13 -0
- package/README.md +846 -11
- package/dist/apptics.esm.min.js +3 -0
- package/dist/apptics.esm.min.js.map +1 -0
- package/dist/apptics.min.js +3 -0
- package/dist/apptics.min.js.map +1 -0
- package/dist/chunks/lifecycle-VYr43KcB.min.js +3 -0
- package/dist/chunks/lifecycle-VYr43KcB.min.js.map +1 -0
- package/dist/cjs/auto-init.d.ts +8 -0
- package/dist/cjs/auto-init.js +32 -0
- package/dist/cjs/core/attempts.d.ts +28 -0
- package/dist/cjs/core/attempts.js +113 -0
- package/dist/cjs/core/batch.d.ts +32 -0
- package/dist/cjs/core/batch.js +116 -0
- package/dist/cjs/core/callsite.d.ts +34 -0
- package/dist/cjs/core/callsite.js +115 -0
- package/dist/cjs/core/consent.d.ts +27 -0
- package/dist/cjs/core/consent.js +132 -0
- package/dist/cjs/core/constants.d.ts +237 -0
- package/dist/cjs/core/constants.js +315 -0
- package/dist/cjs/core/db.d.ts +48 -0
- package/dist/cjs/core/db.js +467 -0
- package/dist/cjs/core/debug.d.ts +22 -0
- package/dist/cjs/core/debug.js +88 -0
- package/dist/cjs/core/env.d.ts +28 -0
- package/dist/cjs/core/env.js +267 -0
- package/dist/cjs/core/framework-id.d.ts +1 -0
- package/dist/cjs/core/framework-id.js +9 -0
- package/dist/cjs/core/guard.d.ts +11 -0
- package/dist/cjs/core/guard.js +86 -0
- package/dist/cjs/core/hooks.d.ts +39 -0
- package/dist/cjs/core/hooks.js +22 -0
- package/dist/cjs/core/locks.d.ts +9 -0
- package/dist/cjs/core/locks.js +22 -0
- package/dist/cjs/core/logger.d.ts +15 -0
- package/dist/cjs/core/logger.js +50 -0
- package/dist/cjs/core/state.d.ts +70 -0
- package/dist/cjs/core/state.js +78 -0
- package/dist/cjs/core/storage.d.ts +61 -0
- package/dist/cjs/core/storage.js +327 -0
- package/dist/cjs/core/stylesheet.d.ts +8 -0
- package/dist/cjs/core/stylesheet.js +29 -0
- package/dist/cjs/core/transport.d.ts +85 -0
- package/dist/cjs/core/transport.js +456 -0
- package/dist/cjs/core/utils.d.ts +26 -0
- package/dist/cjs/core/utils.js +175 -0
- package/dist/cjs/core/validate.d.ts +18 -0
- package/dist/cjs/core/validate.js +233 -0
- package/dist/cjs/device/appversion.d.ts +15 -0
- package/dist/cjs/device/appversion.js +170 -0
- package/dist/cjs/device/index.d.ts +34 -0
- package/dist/cjs/device/index.js +472 -0
- package/dist/cjs/engagement/api-rules.d.ts +49 -0
- package/dist/cjs/engagement/api-rules.js +206 -0
- package/dist/cjs/engagement/auto-api.d.ts +7 -0
- package/dist/cjs/engagement/auto-api.js +200 -0
- package/dist/cjs/engagement/auto-screen.d.ts +18 -0
- package/dist/cjs/engagement/auto-screen.js +305 -0
- package/dist/cjs/engagement/defined-events.d.ts +23 -0
- package/dist/cjs/engagement/defined-events.js +58 -0
- package/dist/cjs/engagement/send.d.ts +6 -0
- package/dist/cjs/engagement/send.js +104 -0
- package/dist/cjs/engagement/session.d.ts +51 -0
- package/dist/cjs/engagement/session.js +463 -0
- package/dist/cjs/engagement/track.d.ts +56 -0
- package/dist/cjs/engagement/track.js +375 -0
- package/dist/cjs/errors/send.d.ts +6 -0
- package/dist/cjs/errors/send.js +73 -0
- package/dist/cjs/errors/track.d.ts +4 -0
- package/dist/cjs/errors/track.js +167 -0
- package/dist/cjs/feedback/controls.d.ts +37 -0
- package/dist/cjs/feedback/controls.js +316 -0
- package/dist/cjs/feedback/index.d.ts +9 -0
- package/dist/cjs/feedback/index.js +56 -0
- package/dist/cjs/feedback/logs.d.ts +45 -0
- package/dist/cjs/feedback/logs.js +241 -0
- package/dist/cjs/feedback/quartz.d.ts +18 -0
- package/dist/cjs/feedback/quartz.js +105 -0
- package/dist/cjs/feedback/send.d.ts +28 -0
- package/dist/cjs/feedback/send.js +203 -0
- package/dist/cjs/feedback/styles.d.ts +10 -0
- package/dist/cjs/feedback/styles.js +8 -0
- package/dist/cjs/feedback/template.d.ts +2 -0
- package/dist/cjs/feedback/template.js +162 -0
- package/dist/cjs/feedback/ui.d.ts +63 -0
- package/dist/cjs/feedback/ui.js +709 -0
- package/dist/cjs/heatmap/send.d.ts +13 -0
- package/dist/cjs/heatmap/send.js +82 -0
- package/dist/cjs/heatmap/track.d.ts +4 -0
- package/dist/cjs/heatmap/track.js +448 -0
- package/dist/cjs/index.d.ts +22 -0
- package/dist/cjs/index.js +162 -0
- package/dist/cjs/lifecycle.d.ts +21 -0
- package/dist/cjs/lifecycle.js +734 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/remoteconfig/country.d.ts +4 -0
- package/dist/cjs/remoteconfig/country.js +73 -0
- package/dist/cjs/remoteconfig/custom.d.ts +10 -0
- package/dist/cjs/remoteconfig/custom.js +58 -0
- package/dist/cjs/remoteconfig/evaluate.d.ts +24 -0
- package/dist/cjs/remoteconfig/evaluate.js +184 -0
- package/dist/cjs/remoteconfig/fetch.d.ts +24 -0
- package/dist/cjs/remoteconfig/fetch.js +200 -0
- package/dist/cjs/remoteconfig/index.d.ts +15 -0
- package/dist/cjs/remoteconfig/index.js +116 -0
- package/dist/cjs/remoteconfig/store.d.ts +18 -0
- package/dist/cjs/remoteconfig/store.js +98 -0
- package/dist/cjs/remoteconfig/tz-countries.d.ts +8 -0
- package/dist/cjs/remoteconfig/tz-countries.js +13 -0
- package/dist/cjs/remotelog/gate.d.ts +2 -0
- package/dist/cjs/remotelog/gate.js +28 -0
- package/dist/cjs/remotelog/index.d.ts +8 -0
- package/dist/cjs/remotelog/logger.d.ts +22 -0
- package/dist/cjs/remotelog/logger.js +111 -0
- package/dist/cjs/remotelog/send.d.ts +13 -0
- package/dist/cjs/remotelog/send.js +153 -0
- package/dist/cjs/remotelogger/index.d.ts +12 -0
- package/dist/cjs/remotelogger/index.js +18 -0
- package/dist/cjs/scheduler.d.ts +8 -0
- package/dist/cjs/scheduler.js +78 -0
- package/dist/cjs/types.d.ts +385 -0
- package/dist/cjs/user/index.d.ts +33 -0
- package/dist/cjs/user/index.js +183 -0
- package/dist/esm/auto-init.d.ts +8 -0
- package/dist/esm/auto-init.js +29 -0
- package/dist/esm/core/attempts.d.ts +28 -0
- package/dist/esm/core/attempts.js +106 -0
- package/dist/esm/core/batch.d.ts +32 -0
- package/dist/esm/core/batch.js +109 -0
- package/dist/esm/core/callsite.d.ts +34 -0
- package/dist/esm/core/callsite.js +110 -0
- package/dist/esm/core/consent.d.ts +27 -0
- package/dist/esm/core/consent.js +122 -0
- package/dist/esm/core/constants.d.ts +237 -0
- package/dist/esm/core/constants.js +292 -0
- package/dist/esm/core/db.d.ts +48 -0
- package/dist/esm/core/db.js +453 -0
- package/dist/esm/core/debug.d.ts +22 -0
- package/dist/esm/core/debug.js +81 -0
- package/dist/esm/core/env.d.ts +28 -0
- package/dist/esm/core/env.js +251 -0
- package/dist/esm/core/framework-id.d.ts +1 -0
- package/dist/esm/core/framework-id.js +7 -0
- package/dist/esm/core/guard.d.ts +11 -0
- package/dist/esm/core/guard.js +83 -0
- package/dist/esm/core/hooks.d.ts +39 -0
- package/dist/esm/core/hooks.js +20 -0
- package/dist/esm/core/locks.d.ts +9 -0
- package/dist/esm/core/locks.js +20 -0
- package/dist/esm/core/logger.d.ts +15 -0
- package/dist/esm/core/logger.js +46 -0
- package/dist/esm/core/state.d.ts +70 -0
- package/dist/esm/core/state.js +73 -0
- package/dist/esm/core/storage.d.ts +61 -0
- package/dist/esm/core/storage.js +314 -0
- package/dist/esm/core/stylesheet.d.ts +8 -0
- package/dist/esm/core/stylesheet.js +27 -0
- package/dist/esm/core/transport.d.ts +85 -0
- package/dist/esm/core/transport.js +439 -0
- package/dist/esm/core/utils.d.ts +26 -0
- package/dist/esm/core/utils.js +161 -0
- package/dist/esm/core/validate.d.ts +18 -0
- package/dist/esm/core/validate.js +226 -0
- package/dist/esm/device/appversion.d.ts +15 -0
- package/dist/esm/device/appversion.js +164 -0
- package/dist/esm/device/index.d.ts +34 -0
- package/dist/esm/device/index.js +461 -0
- package/dist/esm/engagement/api-rules.d.ts +49 -0
- package/dist/esm/engagement/api-rules.js +199 -0
- package/dist/esm/engagement/auto-api.d.ts +7 -0
- package/dist/esm/engagement/auto-api.js +198 -0
- package/dist/esm/engagement/auto-screen.d.ts +18 -0
- package/dist/esm/engagement/auto-screen.js +301 -0
- package/dist/esm/engagement/defined-events.d.ts +23 -0
- package/dist/esm/engagement/defined-events.js +55 -0
- package/dist/esm/engagement/send.d.ts +6 -0
- package/dist/esm/engagement/send.js +101 -0
- package/dist/esm/engagement/session.d.ts +51 -0
- package/dist/esm/engagement/session.js +448 -0
- package/dist/esm/engagement/track.d.ts +56 -0
- package/dist/esm/engagement/track.js +365 -0
- package/dist/esm/errors/send.d.ts +6 -0
- package/dist/esm/errors/send.js +70 -0
- package/dist/esm/errors/track.d.ts +4 -0
- package/dist/esm/errors/track.js +163 -0
- package/dist/esm/feedback/controls.d.ts +37 -0
- package/dist/esm/feedback/controls.js +309 -0
- package/dist/esm/feedback/index.d.ts +9 -0
- package/dist/esm/feedback/index.js +51 -0
- package/dist/esm/feedback/logs.d.ts +45 -0
- package/dist/esm/feedback/logs.js +227 -0
- package/dist/esm/feedback/quartz.d.ts +18 -0
- package/dist/esm/feedback/quartz.js +99 -0
- package/dist/esm/feedback/send.d.ts +28 -0
- package/dist/esm/feedback/send.js +198 -0
- package/dist/esm/feedback/styles.d.ts +10 -0
- package/dist/esm/feedback/styles.js +4 -0
- package/dist/esm/feedback/template.d.ts +2 -0
- package/dist/esm/feedback/template.js +159 -0
- package/dist/esm/feedback/ui.d.ts +63 -0
- package/dist/esm/feedback/ui.js +703 -0
- package/dist/esm/heatmap/send.d.ts +13 -0
- package/dist/esm/heatmap/send.js +79 -0
- package/dist/esm/heatmap/track.d.ts +4 -0
- package/dist/esm/heatmap/track.js +445 -0
- package/dist/esm/index.d.ts +22 -0
- package/dist/esm/index.js +150 -0
- package/dist/esm/lifecycle.d.ts +21 -0
- package/dist/esm/lifecycle.js +729 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/remoteconfig/country.d.ts +4 -0
- package/dist/esm/remoteconfig/country.js +70 -0
- package/dist/esm/remoteconfig/custom.d.ts +10 -0
- package/dist/esm/remoteconfig/custom.js +54 -0
- package/dist/esm/remoteconfig/evaluate.d.ts +24 -0
- package/dist/esm/remoteconfig/evaluate.js +179 -0
- package/dist/esm/remoteconfig/fetch.d.ts +24 -0
- package/dist/esm/remoteconfig/fetch.js +196 -0
- package/dist/esm/remoteconfig/index.d.ts +15 -0
- package/dist/esm/remoteconfig/index.js +111 -0
- package/dist/esm/remoteconfig/store.d.ts +18 -0
- package/dist/esm/remoteconfig/store.js +91 -0
- package/dist/esm/remoteconfig/tz-countries.d.ts +8 -0
- package/dist/esm/remoteconfig/tz-countries.js +11 -0
- package/dist/esm/remotelog/gate.d.ts +2 -0
- package/dist/esm/remotelog/gate.js +26 -0
- package/dist/esm/remotelog/index.d.ts +8 -0
- package/dist/esm/remotelog/logger.d.ts +22 -0
- package/dist/esm/remotelog/logger.js +108 -0
- package/dist/esm/remotelog/send.d.ts +13 -0
- package/dist/esm/remotelog/send.js +149 -0
- package/dist/esm/remotelogger/index.d.ts +12 -0
- package/dist/esm/remotelogger/index.js +13 -0
- package/dist/esm/scheduler.d.ts +8 -0
- package/dist/esm/scheduler.js +74 -0
- package/dist/esm/types.d.ts +385 -0
- package/dist/esm/user/index.d.ts +33 -0
- package/dist/esm/user/index.js +176 -0
- package/dist/feedback.esm.min.js +3 -0
- package/dist/feedback.esm.min.js.map +1 -0
- package/package.json +122 -7
- package/src/appticssdk.js +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
# Apptics JS SDK 2.0.0-beta.1
|
|
4
|
+
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.
|
|
5
|
+
|
|
6
|
+
## The init() keys are base_url, auth_key and app_domain
|
|
7
|
+
- `Apptics.init({ base_url, auth_key, app_domain, appversion })`, in place of 2.0.0-beta's `serviceUrl`, `zak` and `identifier`.
|
|
8
|
+
- 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.
|
|
9
|
+
|
|
10
|
+
## Every call is on the object of its feature
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
| 2.0.0-beta | Now |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `ready()`, `flush()`, `reset()`, `enableDebug()`, `disableDebug()` | `Apptics.ready()`, `Apptics.flush()`, `Apptics.reset()`, `Apptics.enableDebug()`, `Apptics.disableDebug()` |
|
|
16
|
+
| `AppticsTrackError(event, props)`, `enableGlobalErrorHandler(on)` | `AppticsError.trackError(event, properties)`, `AppticsError.trackGlobalErrorHandler(on)` |
|
|
17
|
+
| `AppticsSetUser(userid, groupid, props)`, `getUser()`, `users.UserBuilder` | `AppticsUser.setUser(userid, groupid, props)`, `AppticsUser.getUser()`, `AppticsUser.UserBuilder` |
|
|
18
|
+
| `setTrackingStatus(status)`, `getTrackingStatus()` | `AppticsSettings.setTrackingStatus(status)`, `AppticsSettings.getTrackingStatus()` |
|
|
19
|
+
| `AppticsEvents.addEvent()` | `AppticsEvent.addEvent()` |
|
|
20
|
+
| `AppticsScreenTracker.inScreen()`, `outScreen()` | `AppticsScreen.inScreen()`, `outScreen()` |
|
|
21
|
+
| `AppticsApiTracker.startTrackApi()`, `endTrackApi()`, `configure()`, and `enableApiTracking(on)` | `AppticsApi.startTrackApi()`, `endTrackApi()`, `configure()`, `enableApiTracking(on)` |
|
|
22
|
+
| `AP_TRACKING_STATUS` | `AppticsSettings.AP_TRACKING_STATUS` |
|
|
23
|
+
| `AP_FEEDBACK_TYPE` | `AppticsFeedback.AP_FEEDBACK_TYPE` from `/feedback` |
|
|
24
|
+
| `DefinedEvents` | `AppticsEvent.DefinedEvents` |
|
|
25
|
+
| `ApiTrackingBuilder`, `UserBuilder` | `AppticsApi.ApiTrackingBuilder`, `AppticsUser.UserBuilder` |
|
|
26
|
+
| `addFeedbackLog()`, `addDiagnosticsInfo()` | `AppticsFeedback.addFeedbackLog()`, `AppticsFeedback.addDiagnosticsInfo()` from `/feedback` |
|
|
27
|
+
| `feedbackOpen(type, message, …)`, `feedbackClose()` from `/feedback` | `AppticsFeedback.feedbackFormOpen(options)`, `AppticsFeedback.feedbackFormClose()` from `/feedback` |
|
|
28
|
+
| `sendFeedback(type, message, …)` from `/feedback` | `AppticsFeedback.sendFeedback({ type, message, attachments, logFiles, includeDiagnostics, includeLog, isAnonymous })` |
|
|
29
|
+
| `enableHeatmap(on)` from `/heatmap` | `AppticsHeatmap.trackHeatmap(on)` from the main entry |
|
|
30
|
+
|
|
31
|
+
- `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`.
|
|
32
|
+
- 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".
|
|
33
|
+
- `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.
|
|
34
|
+
- 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.
|
|
35
|
+
- The feedback form lists Feedback first, then Bug, Help and Report, and opens with Feedback selected. The type values (`AP_FEEDBACK_TYPE`) are unchanged.
|
|
36
|
+
- `AppticsHeatmap` is on the main entry. There is no `/heatmap` entry or `heatmap.esm.min.js` any more.
|
|
37
|
+
- `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.
|
|
38
|
+
- Every feedback call, `addFeedbackLog()` and `addDiagnosticsInfo()` included, is on the `/feedback` entry's `AppticsFeedback`. The main entry has no `AppticsFeedback`.
|
|
39
|
+
- 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.
|
|
40
|
+
- The TypeScript type for the whole API, `AppticsApi` in 2.0.0-beta, is `AppticsSdk`: `AppticsApi` is the API-tracking object now.
|
|
41
|
+
|
|
42
|
+
## The feedback form brings its own styles
|
|
43
|
+
- `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.
|
|
44
|
+
|
|
45
|
+
## Screen recording is set up in the console
|
|
46
|
+
- `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.
|
|
47
|
+
|
|
48
|
+
## The remote logger is the app's own lines, logged directly
|
|
49
|
+
- `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.
|
|
50
|
+
- 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).
|
|
51
|
+
- 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.
|
|
52
|
+
- Same levels, 1 to 5; the tag is gone, since the Remote Logger page does not use it.
|
|
53
|
+
- 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.
|
|
54
|
+
|
|
55
|
+
## Remote config follows the console's condition order
|
|
56
|
+
- 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`.
|
|
57
|
+
- **`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.
|
|
58
|
+
- **`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`.
|
|
59
|
+
- `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.
|
|
60
|
+
- `AppticsRemoteConfig.setFallbackWithOfflineValue` is removed: a failed fetch answers with the values fetched before, as it did by default.
|
|
61
|
+
- `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.
|
|
62
|
+
|
|
63
|
+
## Feedback calls take one options object
|
|
64
|
+
- `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`.
|
|
65
|
+
- `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.
|
|
66
|
+
- `feedbackOpen` and `feedbackClose` are `feedbackFormOpen` and `feedbackFormClose`.
|
|
67
|
+
- 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.
|
|
68
|
+
- Feedback is sent even when tracking is off (`NO_TRACKING`): only the feedback goes.
|
|
69
|
+
|
|
70
|
+
## API tracking rules: equals and regex, to allow or to ignore
|
|
71
|
+
- `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.
|
|
72
|
+
- `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.
|
|
73
|
+
- 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.
|
|
74
|
+
|
|
75
|
+
## screen_routes takes exact paths and regular expressions
|
|
76
|
+
- 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.
|
|
77
|
+
|
|
78
|
+
## Heatmaps: trackHeatmap
|
|
79
|
+
- `AppticsHeatmap.trackHeatmap(on?)` starts or stops capture.
|
|
80
|
+
|
|
81
|
+
## Sessions are always recorded
|
|
82
|
+
- 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`.
|
|
83
|
+
|
|
84
|
+
## Storage is tidier
|
|
85
|
+
- 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.
|
|
86
|
+
- 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.
|
|
87
|
+
|
|
88
|
+
## Fixes
|
|
89
|
+
- `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.
|
|
90
|
+
- 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.
|
|
91
|
+
- 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.
|
|
92
|
+
- 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.
|
|
93
|
+
- Stored data waits for `device/add` to answer instead of going out without a `deviceid`.
|
|
94
|
+
- A scroll still settling when heatmaps are switched off (a single-page app leaving a heatmap page) is recorded, not dropped.
|
|
95
|
+
- `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.
|
|
96
|
+
- An invalid event, group or screen name is said in the console once, with console logging off too.
|
|
97
|
+
- 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.
|
|
98
|
+
- 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).
|
|
99
|
+
- `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.
|
|
100
|
+
- 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.
|
|
101
|
+
- 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.
|
|
102
|
+
- 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).
|
|
103
|
+
- 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.
|
|
104
|
+
- Click tracking reads `data-apeventaction`, `data-apgroupaction` and `data-apeventprops` too, the spelling React and TypeScript accept without declaring the attributes.
|
|
105
|
+
- `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.
|
|
106
|
+
- 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.
|
|
107
|
+
- 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.
|
|
108
|
+
- 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`.
|
|
109
|
+
|
|
110
|
+
# Apptics JS SDK 2.0.0-beta
|
|
111
|
+
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+.
|
|
112
|
+
|
|
113
|
+
## Initialization
|
|
114
|
+
- **The Android SDK's 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.
|
|
115
|
+
- **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`.
|
|
116
|
+
- **`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.
|
|
117
|
+
- **`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`.
|
|
118
|
+
- **`ready()`**: a Promise that resolves once the SDK is running. Calls made between `Apptics.init()` and that point are queued and replayed in order.
|
|
119
|
+
- Calls that track or send something before `Apptics.init()` are ignored, and the first one logs a console warning saying so.
|
|
120
|
+
- **`mute()` and `unmute()` are removed.** `setTrackingStatus(AP_TRACKING_STATUS.NO_TRACKING)` stops tracking, and unlike `mute()` it is stored across visits.
|
|
121
|
+
- Safe to import during server-side rendering; nothing runs until `Apptics.init()` is called in the browser. Public calls never throw into the host app.
|
|
122
|
+
- **Storage**: IndexedDB with a localStorage fallback. Data stored by 1.0.2 is migrated on the first visit. Queued items are stored one per record and a Web Lock keeps two tabs from sending the same data.
|
|
123
|
+
|
|
124
|
+
## Packaging and CDN
|
|
125
|
+
- **npm**: `import` and `require()` both work, with type declarations. Optional modules are separate entry points, so apps ship only what they use: `@zoho_apptics/apptics-js-sdk/feedback`, `/heatmap`, `/remote-config` and `/style.css`.
|
|
126
|
+
- **One script tag**: the CDN builds (`apptics.min.js`, `feedback.esm.min.js`) load the feedback form's `style.css` themselves, so a page needs no separate `<link>`. `apptics.min.js` includes every module on `window.apptics`.
|
|
127
|
+
- **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.
|
|
128
|
+
|
|
129
|
+
## Events
|
|
130
|
+
- **Defined events, as on Android**: `AppticsEvents.addEvent(DefinedEvents.AP_USER_LOGIN, props?)` logs Apptics' ready-made events under their own `AP_` groups.
|
|
131
|
+
- **`ap_` / `AP_` is reserved**: an app's event, group or property key starting with it is not logged.
|
|
132
|
+
- **An event with an invalid group is not logged**, as on Android, instead of being filed under `default`; an event with no group is still `default`.
|
|
133
|
+
- **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.
|
|
134
|
+
|
|
135
|
+
## Sessions
|
|
136
|
+
- **`track_session: false`** turns automatic sessions off, as Android's `automaticSessionsTrackingStatus = false`; events and screens are still recorded.
|
|
137
|
+
|
|
138
|
+
## Screen Tracking
|
|
139
|
+
- **`trackScreen()` is renamed `AppticsScreenTracker.inScreen()`**, as in the Android SDK: 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.
|
|
140
|
+
- **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, as Android's `outScreen`. Until now every view was recorded with no time spent.
|
|
141
|
+
- **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.
|
|
142
|
+
- **`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.
|
|
143
|
+
|
|
144
|
+
## Remote Logger
|
|
145
|
+
- **`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 in the Android and iOS order. 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.
|
|
146
|
+
- **Android's names too**: `AppticsLogger.v/d/i/w/e(tag, message)`, with the tag leading the message as `[tag]`, and `AppticsLogger.disable()`.
|
|
147
|
+
- **`show_logs: true`** prints the app's lines to the browser console as well, as Android's `showLogs` does for Logcat.
|
|
148
|
+
- **Offline storage is capped at 1 MB**, oldest lines dropped first, as on Android (instead of 200 lines).
|
|
149
|
+
- **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`.
|
|
150
|
+
|
|
151
|
+
## API Tracking
|
|
152
|
+
- **Path normalization, as on Android**: 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`).
|
|
153
|
+
- **`AppticsApiTracker.configure(new ApiTrackingBuilder()...build())`** with Android's rules: `ignoreDomains`, `allowOnlyDomains`, `allowOnlyTLDs`, `ignoreTLDs`, `ignoreDomainPrefixes`, `ignoreDomainSuffixes`, `groupDomains`, `ignoreEndpoint`, `addPattern`, `preserveSegments`, `autoDetection`. They apply to every call.
|
|
154
|
+
- **`AppticsApiTracker.startTrackApi(url, method)` / `AppticsApiTracker.endTrackApi(id, code)`** time and record a call, as on Android.
|
|
155
|
+
- **`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.
|
|
156
|
+
|
|
157
|
+
## Remote Config
|
|
158
|
+
- **`AppticsRemoteConfig`** from `@zoho_apptics/apptics-js-sdk/remote-config` (`AppticsRemoteConfig` in the `<script>` build): four calls, as on Android: `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`.
|
|
159
|
+
- **`setCustomConditionValue(key, value)`**, as on Android: conditions on a custom criteria match this device's value. Kept across visits; works before `Apptics.init()`.
|
|
160
|
+
- **`fetchValue(name)`** and **`fetchValues({ name: default })`**, as on Android: Promises, with an optional callback. A parameter the console doesn't have is `null`.
|
|
161
|
+
- **Fetched on start-up**, so values are this session's without the app asking.
|
|
162
|
+
- **A fetch from the last five minutes is reused**; `coldFetch` asks the server regardless, at most three times a minute.
|
|
163
|
+
- **`setFallbackWithOfflineValue(false)`**: a failed fetch answers with `null` and defaults instead of the values fetched before (the default).
|
|
164
|
+
|
|
165
|
+
## Heatmap
|
|
166
|
+
- **Every heatmap record has its screen view in `engagement/add`**: when nothing has named the screen (automatic screen tracking off, no `AppticsScreenTracker.inScreen()`), the first record on a page records a view of it, so the console can place the record.
|
|
167
|
+
- **Heatmaps**: clicks (with rage and dead clicks) and scrolls, for the Apptics console. Off by default; `track_heatmap: true` plus an import of `@zoho_apptics/apptics-js-sdk/heatmap`. An element's visible text is used for its label only with `USAGE_TRACKING_WITH_PII`.
|
|
168
|
+
|
|
169
|
+
## Debugging
|
|
170
|
+
- **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.
|
|
171
|
+
- **`debug` now means debug mode.** In 1.0.2 it turned on browser-console logging.
|
|
172
|
+
|
|
173
|
+
## Feedback
|
|
174
|
+
- **`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`.
|
|
175
|
+
- `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.
|
|
176
|
+
|
|
177
|
+
## Server APIs
|
|
178
|
+
- 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.
|
|
179
|
+
|
|
180
|
+
## Fixes (2.0.0-beta)
|
|
181
|
+
- Queued engagements, errors and heatmap records are removed only once the server accepts them; a failed send (5xx, timeout, CORS, dropped connection) goes again instead of being lost.
|
|
182
|
+
- Page-close sends stay within the browser's 64 KiB keepalive limit; a larger batch is kept for the next visit.
|
|
183
|
+
- The flush timer never sent errors; engagements, errors and heatmaps now go out in turn.
|
|
184
|
+
- The server's "stop tracking" signal was ignored.
|
|
185
|
+
- `ignore_do_not_track: true` disabled tracking instead of ignoring the browser's Do Not Track setting.
|
|
186
|
+
- Click tracking with `apeventaction` required jQuery.
|
|
187
|
+
- The SDK crashed without `screen.orientation`.
|
|
188
|
+
- Send timers multiplied on every reconnect; devices were registered twice; the device update on an app-version change was sent empty.
|
|
189
|
+
- A successful error send wiped errors recorded while it was in flight.
|
|
190
|
+
- Requests now time out after 30 seconds, and ids in request URLs are encoded.
|
|
191
|
+
|
|
192
|
+
# Apptics JS SDK 1.0.2
|
|
193
|
+
- First releases on npm (1.0.0, 1.0.1 and 1.0.2, August 2025). The SDK ran alongside the Apptics console snippet and exported nothing for `import` or `require()`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright (c) 2025 Zoho Corporation Private Limited
|
|
2
|
+
|
|
3
|
+
Zoho grants you a limited, revocable, non-exclusive, non-sublicensable license to copy, install and use the Zoho Apptics JavaScript SDK (the "SDK") solely in connection with your use of Zoho Apptics in your websites and web applications. This license includes the right to:
|
|
4
|
+
(a) install the SDK from a package registry such as npm, or load it from a content delivery network;
|
|
5
|
+
(b) bundle, transpile, minify or otherwise process the SDK with your web application's build tools; and
|
|
6
|
+
(c) serve the SDK, processed only as described in (b), to your end users' browsers as part of your website or web application.
|
|
7
|
+
|
|
8
|
+
You will not:
|
|
9
|
+
(i) modify, adapt, translate or otherwise create derivative works of the SDK, except as permitted in (b);
|
|
10
|
+
(ii) reverse engineer, deobfuscate, decompile, disassemble or otherwise attempt to discover the source code of the SDK;
|
|
11
|
+
(iii) rent, sell, assign, sublicense or otherwise transfer rights in the SDK, or distribute it other than as part of your website or web application as permitted in (c);
|
|
12
|
+
(iv) remove any proprietary notices or licenses from the SDK; or
|
|
13
|
+
(v) use, post, publish, transmit or introduce any device, software or routine that interferes or attempts to interfere with the operation of the SDK or of Zoho Apptics.
|