@kk-forge/artel-collector 0.2.0 → 0.3.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/README.md CHANGED
@@ -32,9 +32,9 @@ A product with its own analytics switch calls `setState('opted_out')` once for e
32
32
  ### Languages
33
33
 
34
34
  - `browserLanguage` is the user's language: the one the browser asks sites for, `navigator.language` by default on the web and in an extension.
35
- - `uiLanguage` is the language the product shows its interface in, the outcome of its own localization. An extension sends by default the locale Chrome picked from its `_locales`. Each `_locales/<locale>/messages.json` holds a `ui_language` message whose value is that locale's code, such as `pt-BR`. The collector reads it with `chrome.i18n.getMessage('ui_language')`, reading `_` as `-`. The publication kit of the intake's admin writes that message. Without that message an extension sends none. A website or a desktop app passes it, or sends none.
35
+ - `uiLanguage` is the language the user picked in the product, when the product offers that choice. Only the product's option sets it, on every platform. A product without that choice passes none, and its envelopes carry no `ui_language`.
36
36
 
37
- The two differ when the product has no translation into the user's language, so the intake can count the users a translation would serve. In the `anonymous` state both are cut to the primary language: `pt-BR` goes as `pt`, `zh-Hant-TW` as `zh`.
37
+ In the `anonymous` state both are cut to the primary language: `pt-BR` goes as `pt`, `zh-Hant-TW` as `zh`.
38
38
 
39
39
  ## Usage
40
40
 
@@ -43,7 +43,7 @@ Each `const usage` line makes a collector. `key`, `version` and `endpoint` are v
43
43
  ```ts
44
44
  // a website or a web app
45
45
  const usage = newWebCollector({ key, version, endpoint, mode: 'anonymous' });
46
- const usage = newWebCollector({ key, version, endpoint, mode: 'identified', getId, uiLanguage: i18n.language });
46
+ const usage = newWebCollector({ key, version, endpoint, mode: 'identified', getId, uiLanguage: settings.language });
47
47
  // a site whose paths carry a secret or a person sends the route pattern instead
48
48
  const usage = newWebCollector({
49
49
  key,
@@ -56,20 +56,12 @@ const usage = newWebCollector({
56
56
  // a Chrome extension, in the service worker and in each page
57
57
  const usage = newExtensionCollector({ key, endpoint, mode: 'anonymous' });
58
58
  const usage = newExtensionCollector({ key, endpoint, mode: 'identified', getId });
59
+ // a content script of that extension, which hands its events to the service worker
60
+ const usage = newContentScriptCollector();
59
61
 
60
- // a desktop app, here a Tauri window over the web module's storage and lock
61
- const desktop = {
62
- key,
63
- platform: 'macos',
64
- version,
65
- endpoint,
66
- browserLanguage: navigator.language,
67
- uiLanguage: i18n.language,
68
- storage: newLocalStorageAdapter(),
69
- lock: newWebLock(),
70
- } as const;
71
- const usage = newCollector({ ...desktop, mode: 'anonymous' });
72
- const usage = newCollector({ ...desktop, mode: 'identified', getId });
62
+ // a window of a desktop app, such as a Tauri webview, where `platform` is 'macos', 'windows' or 'linux'
63
+ const usage = newDesktopCollector({ key, version, endpoint, platform, mode: 'anonymous' });
64
+ const usage = newDesktopCollector({ key, version, endpoint, platform, mode: 'identified', getId });
73
65
  ```
74
66
 
75
67
  Then track what the user does, and store their choice when they make it, here in an identified channel:
@@ -80,20 +72,20 @@ void usage.setState(consented ? 'identified' : 'anonymous');
80
72
  void usage.setState('opted_out'); // the user turned usage statistics off
81
73
  ```
82
74
 
83
- `newWebCollector` comes from `@kk-forge/artel-collector/web`, `newExtensionCollector` from `@kk-forge/artel-collector/extension`, and `newCollector` from the main module. Each platform constructor sets `platform`, fills in the defaults in the table below, and passes the result to `newCollector`. An option left out or `undefined` takes its default. Each constructor takes `mode` as the literal `'anonymous'` or `'identified'`, and returns a collector whose `setState` takes only that channel's states. A `mode` known only at run time goes in options typed `CollectorOptions`, `WebCollectorOptions` or `ExtensionCollectorOptions` and built per mode, and gives a collector whose `setState` takes every state.
75
+ `newWebCollector` comes from `@kk-forge/artel-collector/web`, `newExtensionCollector` and `newContentScriptCollector` from `@kk-forge/artel-collector/extension`, `newDesktopCollector` from `@kk-forge/artel-collector/desktop`, and `newCollector` from the main module. Each platform constructor fills in the defaults in the table below and passes the result to `newCollector`. The web and extension constructors set `platform`, and the desktop one takes it. An option left out or `undefined` takes its default. Each constructor takes `mode` as the literal `'anonymous'` or `'identified'`, and returns a collector whose `setState` takes only that channel's states. A `mode` known only at run time goes in options typed `CollectorOptions`, `WebCollectorOptions`, `ExtensionCollectorOptions` or `DesktopCollectorOptions` and built per mode, and gives a collector whose `setState` takes every state. `newContentScriptCollector` takes no channel options, as "`@kk-forge/artel-collector/extension`" describes.
84
76
 
85
- Each constructor throws a `TypeError` that names the option when the options would make the intake refuse every envelope. A mistake in the build then fails its first run and its tests. That is a `key`, `platform` or `version` the intake does not take, an `endpoint` that is not `https`, or a `transport` that is not a function, as "Options" describes. It also throws for a `browser` on a desktop platform, which only untyped code passes and whose envelopes the intake refuses. The message never quotes the endpoint, so it carries no password. `newWebCollector` and `newExtensionCollector` also throw where `navigator` is missing, unless the options pass `browserLanguage`. Node 21.2 and later define `navigator.language`, so server rendering there builds a collector with the server's language. `newExtensionCollector` also throws outside an extension context unless the options pass both `version` and `uiLanguage`. A `browserLanguage` or `uiLanguage` that breaks the format throws nothing: the collector leaves it out and reports it to `onError`, since it often comes from the browser.
77
+ Each constructor throws a `TypeError` that names the option when the options would make the intake refuse every envelope. A mistake in the build then fails its first run and its tests. That is a `key`, `platform` or `version` the intake does not take, an `endpoint` that is not `https`, or a `transport` that is not a function, as "Options" describes. It also throws for a `browser` on a desktop platform, which only untyped code passes and whose envelopes the intake refuses. The message never quotes the endpoint, so it carries no password. `newWebCollector`, `newExtensionCollector` and `newDesktopCollector` also throw where `navigator` is missing, unless the options pass `browserLanguage`. Node 21.2 and later define `navigator.language`, so server rendering there builds a collector with the server's language. `newExtensionCollector` also throws outside an extension context unless the options pass `version`. `newContentScriptCollector` never throws. A `browserLanguage` or `uiLanguage` that breaks the format throws nothing: the collector leaves it out and reports it to `onError`, since it often comes from the browser.
86
78
 
87
- | Option | `newWebCollector` | `newExtensionCollector` |
88
- | -------------------------- | -------------------------------- | --------------------------------------- |
89
- | `platform` | `web` | `extension` |
90
- | `version` | required | the manifest's |
91
- | `storage` | `newLocalStorageAdapter()` | `newChromeStorageAdapter()` |
92
- | `lock` | `newWebLock()` | `newWebLock()` |
93
- | `browserLanguage` | `navigator.language` | `navigator.language` |
94
- | `uiLanguage` | none | `chrome.i18n.getMessage('ui_language')` |
95
- | `getPage` | `pageFields`, see below | not taken |
96
- | `browser`, identified only | `() => detectBrowser(navigator)` | `() => detectBrowser(navigator)` |
79
+ | Option | `newWebCollector` | `newExtensionCollector` | `newDesktopCollector` |
80
+ | -------------------------- | -------------------------------- | -------------------------------- | ------------------------------------- |
81
+ | `platform` | `web` | `extension` | required: `macos`, `windows`, `linux` |
82
+ | `version` | required | the manifest's | required |
83
+ | `storage` | `newLocalStorageAdapter()` | `newChromeStorageAdapter()` | `newLocalStorageAdapter()` |
84
+ | `lock` | `newWebLock()` | `newWebLock()` | `newWebLock()` |
85
+ | `browserLanguage` | `navigator.language` | `navigator.language` | `navigator.language` |
86
+ | `uiLanguage` | none | none | none |
87
+ | `getPage` | `pageFields`, see below | not taken | not taken |
88
+ | `browser`, identified only | `() => detectBrowser(navigator)` | `() => detectBrowser(navigator)` | not taken |
97
89
 
98
90
  ### Options
99
91
 
@@ -139,7 +131,7 @@ Each constructor throws a `TypeError` that names the option when the options wou
139
131
  - a language the collector leaves out, a state `setState` refuses, an id past 64 characters, an id `forget` refuses, a transport status that is no HTTP status, a page the collector leaves out, and a page field that is not a string;
140
132
  - a storage, lock, `getId`, `browser` or `getPage` error, and an extension worker's `setAccessLevel` that fails.
141
133
 
142
- A request that goes again later, after a network failure, 429 or 5xx, does not reach it. Its envelope reaches it only when a drop rule removes it. These reach no `onError` of the collector: a forwarded event the extension worker refuses or drops, a `forwardTrack` that fails, and a failure of `refreshUninstallUrl` outside `uninstallParams()`, which goes to that function's own `onError`.
134
+ A request that goes again later, after a network failure, 429 or 5xx, does not reach it. Its envelope reaches it only when a drop rule removes it. These reach no `onError` of the collector: a forwarded event the extension worker refuses or drops, a `forwardTrack` or a content script's `track` that fails, and a failure of `refreshUninstallUrl` outside `uninstallParams()`, which goes to that function's own `onError`.
143
135
 
144
136
  ### Methods
145
137
 
@@ -172,7 +164,7 @@ Every method returns a promise that resolves and never rejects. A failure goes t
172
164
 
173
165
  `detectBrowser(nav)` names the browser from the `userAgentData.brands` and `userAgent` of the `navigator` it is given. It returns `{ name, major }`, where `name` is `chrome`, `edge`, `opera`, `yandex`, `brave`, `firefox` or `safari`, and leaves out a major version outside 1 to 999. Any other browser is `{ name: 'other' }`. Chrome is named only by its brands, since every Chromium browser carries Chrome's User-Agent token. It returns `undefined` when `nav` has neither a Chromium brand nor a User-Agent.
174
166
 
175
- The main module also exports `newHttpTransport(endpoint, { fetch, clock }?)`, the transport behind `endpoint`, `newMemoryStorage()`, `systemClock`, `Mode`, `AnalyticsState`, `Platform`, `ActiveDaysBucket` and `BrowserName`, and the types of every option, method and value above. `WebCollectorOptions` and `ExtensionCollectorOptions` come from their own modules.
167
+ The main module also exports `newHttpTransport(endpoint, { fetch, clock }?)`, the transport behind `endpoint`, `newMemoryStorage()`, `systemClock`, `Mode`, `AnalyticsState`, `Platform`, `ActiveDaysBucket` and `BrowserName`, and the types of every option, method and value above. `WebCollectorOptions`, `ExtensionCollectorOptions` and `DesktopCollectorOptions` come from their own modules.
176
168
 
177
169
  ## Sending
178
170
 
@@ -198,11 +190,11 @@ A `get` or `set` that fails goes to `onError`, and the method that called it sto
198
190
 
199
191
  ## Platform modules
200
192
 
201
- The core touches no platform API. Two optional modules hold the code a website or an extension would otherwise write for itself.
193
+ The core touches no platform API. Three optional modules hold the code a website, an extension or a desktop app would otherwise write for itself.
202
194
 
203
195
  ### `@kk-forge/artel-collector/web`
204
196
 
205
- For a website, a web app, or a window of a Tauri desktop app.
197
+ For a website or a web app. The desktop module builds on its storage and lock.
206
198
 
207
199
  - `newWebCollector(options)` makes a collector for a website or a web app, as in "Usage".
208
200
  - `newLocalStorageAdapter()` returns a `storage` over `localStorage`. Every script of the origin can read it, the queued events with their `id` and the last id `getId` gave included, and no other storage of the origin hides them from its scripts. A site that runs untrusted scripts uses an anonymous channel.
@@ -229,6 +221,7 @@ For a Chrome extension. Its service worker and its pages each make a collector w
229
221
 
230
222
  - `newExtensionCollector(options)` makes a collector for the service worker or a page, as in "Usage". It needs the `storage` permission. In the service worker it closes `chrome.storage.local` to content scripts with `setAccessLevel({ accessLevel: 'TRUSTED_CONTEXTS' })`, since a content script that could write the user's choice, the queue and the last id `getId` gave could send events the user refused. The collector reads and writes no storage until Chrome answers the call, and a failure of the call goes to `onError`. The call runs only in the service worker, so build the collector at the top level of the worker: until it runs, content scripts keep access to `chrome.storage.local`. The call closes the whole `chrome.storage.local` area, every key and not only the collector's, even when the product passes its own `storage`. So a content script of the product that reads its own settings there must get them from the worker instead. `setAccessLevel` needs Chrome 102 or later. The collector calls it again on each start of the service worker.
231
223
  - `newChromeStorageAdapter()` returns a `storage` over `chrome.storage.local`.
224
+ - `newContentScriptCollector()` returns the collector of a content script, typed `ContentScriptCollector`: `track` and `flush` only. Its `track` is `forwardTrack`, so the worker's collector checks, queues and sends the event under the user's choice, and `flush` does nothing. The user's choice lives in the service worker and the extension pages, so a content script can neither read nor change it, and its types say so. It reads no storage, needs no key, version or endpoint, and never throws.
232
225
  - `forwardTrack(name, params?)` hands an event from a content script to the service worker. A content script's own requests carry the page's origin, which the intake refuses. It never rejects. While the worker cannot take the message, as during an update, the event is lost.
233
226
  - `acceptForwarded(collector, { clock }?)` tracks, in the service worker, the events content scripts forward, and returns the function that stops it. It takes them only from this extension, and only the product's own events. It refuses every system event of the intake, which the intake counts from any product without its allowlist: `installed`, `updated`, `opted_out`, `uninstalled`, `welcome_opened`, `page_view` and `install_click`. It also refuses each event `track` refuses. A page can open any number of frames that run the content script. So the worker tracks at most 60 forwarded events a minute from all tabs and frames together, and drops the rest. It keeps the count in memory, so a restart of the worker starts it again. `clock` is the time source, as in Options.
234
227
  - `refreshUninstallUrl(collector, pageUrl, { onError }?)` sets the uninstall page to `pageUrl` with the fields of `uninstallParams()` added to its query, or to `pageUrl` alone when `uninstallParams()` resolves to `undefined`. Chrome keeps the address as it was set, so call it on each start of the worker and after each `setState`. It never rejects. A failure of `uninstallParams()` goes to the collector's `onError`, and any other failure to the function's own `onError`.
@@ -257,11 +250,18 @@ async function storeChoice(choice: AnalyticsState): Promise<void> {
257
250
  }
258
251
 
259
252
  // content script
260
- import { forwardTrack } from '@kk-forge/artel-collector/extension';
253
+ import { newContentScriptCollector } from '@kk-forge/artel-collector/extension';
261
254
 
262
- void forwardTrack('link_shared', { target: 'clipboard' });
255
+ const usage = newContentScriptCollector();
256
+ void usage.track('link_shared', { target: 'clipboard' });
263
257
  ```
264
258
 
259
+ ### `@kk-forge/artel-collector/desktop`
260
+
261
+ For a window of a desktop app, such as a Tauri webview.
262
+
263
+ - `newDesktopCollector(options)` makes a collector for a desktop window, as in "Usage". It takes `platform` as `'macos'`, `'windows'` or `'linux'`, the platforms a `desktop` channel takes. Its windows share the webview's `localStorage` through `newLocalStorageAdapter()` and its Web Locks through `newWebLock()`, so they keep one queue and one state. It names no browser and sends no page.
264
+
265
265
  ## What is sent
266
266
 
267
267
  One envelope per request. An envelope in the `anonymous` state, in either channel:
@@ -328,7 +328,7 @@ mise run check:ci # the same with coverage, as CI runs it
328
328
 
329
329
  ## Release
330
330
 
331
- Versions follow semver: a breaking change to the API this README describes raises the major version, or the minor one before 1.0.0. `src/exports.unit.test.ts` holds the names of that API's values and types. Raise `version` in `package.json` in a PR, as `X.Y.Z`: the release workflow takes no prerelease version. Once it merges to `main`, `.github/workflows/release.yml` checks the package and waits for a reviewer of the `production` environment to approve the publish. It then publishes the package to npm with provenance and tags `v<version>`. npm trusts that workflow as the package's Trusted Publisher, so the repository keeps no npm token. A merge that keeps the version publishes no new release. When the tag job fails after the publish, rerun that run's failed jobs, so the tag lands on the published commit. Until the tag exists, a later merge that keeps the version fails at the publish.
331
+ Versions follow semver: a breaking change to the API this README describes raises the major version, or the minor one before 1.0.0. `src/exports.unit.test.ts` holds the names of that API's values and types. Raise `version` in `package.json` in a PR, as `X.Y.Z`: the release workflow takes no prerelease version. Once it merges to `main`, `.github/workflows/release.yml` runs the shared [Release npm](https://github.com/kk-forge-engineering/gh-actions/blob/main/.github/workflows/release-npm.yml) workflow. It checks the package and waits for a reviewer of the `production` environment to approve the publish. It then publishes the package to npm with provenance and tags `v<version>`. npm trusts `release.yml` as the package's Trusted Publisher, so the repository keeps no npm token. A merge that keeps the version publishes no new release.
332
332
 
333
333
  ## License
334
334
 
@@ -46,7 +46,7 @@ export interface CommonOptions {
46
46
  version: string;
47
47
  /** The user's language, such as `pt-BR`: what the browser asks sites for. */
48
48
  browserLanguage?: string | undefined;
49
- /** The language the product shows its interface in: the outcome of its own localization. */
49
+ /** The language the user picked in the product, when the product offers that choice. Left out otherwise. */
50
50
  uiLanguage?: string | undefined;
51
51
  storage: StorageAdapter;
52
52
  /** Minutes without events that end a session, 10 by default. */
@@ -0,0 +1,29 @@
1
+ import type { Collector, CommonOptions, Delivery, Mode, ModeOptions } from './collectorTypes.js';
2
+ import type { Platform } from './envelope.js';
3
+ import type { StorageAdapter } from './storage.js';
4
+ /**
5
+ * The options of `newDesktopCollector`: those of `newCollector` with `storage` optional and a desktop `platform`. An
6
+ * option left out or `undefined` takes its default.
7
+ */
8
+ export type DesktopCollectorOptions = Omit<CommonOptions, 'storage'> & {
9
+ /** The operating system the app runs on, as the intake names it. */
10
+ platform: typeof Platform.MacOs | typeof Platform.Windows | typeof Platform.Linux;
11
+ /** The storage, the webview's `localStorage` by default. */
12
+ storage?: StorageAdapter | undefined;
13
+ /** A desktop product names no browser. */
14
+ browser?: never;
15
+ /** A desktop product sends no page. */
16
+ getPage?: never;
17
+ } & Delivery & ModeOptions;
18
+ /**
19
+ * Returns a collector for a window of a desktop app, such as a Tauri webview. Its windows share the webview's
20
+ * `localStorage` and Web Locks, so they keep one queue and one state. It sends the user's language from
21
+ * `navigator.language`. The app passes its own `uiLanguage`.
22
+ */
23
+ export declare function newDesktopCollector(options: DesktopCollectorOptions & {
24
+ mode: typeof Mode.Identified;
25
+ }): Collector<'identified'>;
26
+ export declare function newDesktopCollector(options: DesktopCollectorOptions & {
27
+ mode: typeof Mode.Anonymous;
28
+ }): Collector<'anonymous'>;
29
+ export declare function newDesktopCollector(options: DesktopCollectorOptions): Collector;
@@ -0,0 +1,10 @@
1
+ import { newCollector } from './collector.js';
2
+ import { newLocalStorageAdapter, newWebLock } from './web.js';
3
+ export function newDesktopCollector(options) {
4
+ return newCollector({
5
+ ...options,
6
+ storage: options.storage ?? newLocalStorageAdapter(),
7
+ lock: options.lock ?? newWebLock(),
8
+ browserLanguage: options.browserLanguage ?? navigator.language,
9
+ });
10
+ }
@@ -36,6 +36,15 @@ export declare function newChromeStorageAdapter(): StorageAdapter;
36
36
  * script's own requests, which carry the page's origin.
37
37
  */
38
38
  export declare function forwardTrack(name: string, params?: EventParams): Promise<void>;
39
+ /** The part of the collector a content script uses: it tracks events, and the worker keeps the user's choice. */
40
+ export type ContentScriptCollector = Pick<Collector, 'track' | 'flush'>;
41
+ /**
42
+ * Returns the collector of a content script. Its `track` hands each event to the service worker with `forwardTrack`,
43
+ * and the worker's collector checks, queues and sends it under the user's choice, so `flush` does nothing here. The
44
+ * user's choice lives in the worker and the extension pages, so a content script can neither read nor change it. It
45
+ * reads no storage, needs no key, version or endpoint, and never throws.
46
+ */
47
+ export declare function newContentScriptCollector(): ContentScriptCollector;
39
48
  /**
40
49
  * Tracks the events content scripts forward with `forwardTrack`, at most 60 a minute. It takes them only from this
41
50
  * extension, and only the product's own events: never a system event of the intake, such as `installed` or
package/dist/extension.js CHANGED
@@ -6,8 +6,6 @@ import { Platform, SYSTEM_EVENTS } from './envelope.js';
6
6
  import { eventProblem } from './eventCheck.js';
7
7
  import { reportTo } from './hostInput.js';
8
8
  import { newWebLock } from './web.js';
9
- /** The message in each of the extension's `_locales` that holds that locale's code, such as `pt-BR`. */
10
- const UI_LANGUAGE_MESSAGE = 'ui_language';
11
9
  const FORWARD_TYPE = 'artel.track';
12
10
  /**
13
11
  * The event names the worker refuses from a content script: every system event, which the intake counts from any page
@@ -25,13 +23,12 @@ export function newExtensionCollector(options) {
25
23
  const closed = isServiceWorker() ? closeToContentScripts(options.onError) : Promise.resolve();
26
24
  const defaults = {
27
25
  platform: Platform.Extension,
28
- // The function reads each default only when the caller leaves the option out. A test's fake browser may lack the
29
- // manifest and `chrome.i18n`.
26
+ // The function reads each default only when the caller leaves the option out, so outside an extension it needs only
27
+ // `version`.
30
28
  version: options.version ?? chromeApi().runtime.getManifest().version,
31
29
  storage: after(closed, options.storage ?? newChromeStorageAdapter()),
32
30
  lock: options.lock ?? newWebLock(),
33
31
  browserLanguage: options.browserLanguage ?? navigator.language,
34
- uiLanguage: options.uiLanguage ?? localeOfExtension(),
35
32
  };
36
33
  return options.mode === Mode.Identified
37
34
  ? newCollector({ ...options, ...defaults, browser: options.browser ?? (() => detectBrowser(navigator)) })
@@ -71,14 +68,6 @@ function after(ready, storage) {
71
68
  },
72
69
  };
73
70
  }
74
- /**
75
- * Returns the locale Chrome picked from the extension's `_locales`, which each locale names in its `ui_language`
76
- * message, or undefined when the extension has no such message. Chrome gives no other way to read that choice.
77
- */
78
- function localeOfExtension() {
79
- const locale = chromeApi().i18n?.getMessage(UI_LANGUAGE_MESSAGE);
80
- return locale === undefined || locale === '' ? undefined : locale;
81
- }
82
71
  /**
83
72
  * Returns a storage adapter over `chrome.storage.local`, which the service worker and the extension pages share. It
84
73
  * needs the `storage` permission.
@@ -106,6 +95,15 @@ export async function forwardTrack(name, params) {
106
95
  // The send fails while the service worker updates or is gone. The content script drops the event and does not fail.
107
96
  }
108
97
  }
98
+ /**
99
+ * Returns the collector of a content script. Its `track` hands each event to the service worker with `forwardTrack`,
100
+ * and the worker's collector checks, queues and sends it under the user's choice, so `flush` does nothing here. The
101
+ * user's choice lives in the worker and the extension pages, so a content script can neither read nor change it. It
102
+ * reads no storage, needs no key, version or endpoint, and never throws.
103
+ */
104
+ export function newContentScriptCollector() {
105
+ return { track: forwardTrack, flush: async () => undefined };
106
+ }
109
107
  /**
110
108
  * Tracks the events content scripts forward with `forwardTrack`, at most 60 a minute. It takes them only from this
111
109
  * extension, and only the product's own events: never a system event of the intake, such as `installed` or
package/dist/web.d.ts CHANGED
@@ -11,8 +11,7 @@ export type WebCollectorOptions = Omit<CommonOptions, 'storage'> & {
11
11
  /**
12
12
  * Returns a collector for a website or a web app. It runs over `localStorage` and Web Locks, and sends the user's
13
13
  * language from `navigator.language`, the page from `pageFields` and, in the identified state, the browser from
14
- * `detectBrowser`. The site passes its own `uiLanguage`. A Tauri desktop window builds its own with `newCollector` and
15
- * this module's helpers.
14
+ * `detectBrowser`. The site passes its own `uiLanguage`. A desktop window uses `newDesktopCollector`.
16
15
  */
17
16
  export declare function newWebCollector(options: WebCollectorOptions & {
18
17
  mode: typeof Mode.Identified;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kk-forge/artel-collector",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Sends a product's usage events to the intake service",
5
5
  "license": "MIT",
6
6
  "author": "KK Forge",
@@ -27,6 +27,10 @@
27
27
  "./extension": {
28
28
  "types": "./dist/extension.d.ts",
29
29
  "default": "./dist/extension.js"
30
+ },
31
+ "./desktop": {
32
+ "types": "./dist/desktop.d.ts",
33
+ "default": "./dist/desktop.js"
30
34
  }
31
35
  },
32
36
  "publishConfig": {