@koolbase/js 10.2.0 → 10.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/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ is based on [Keep a Changelog][kac], and this project adheres to
7
7
  [kac]: https://keepachangelog.com/en/1.1.0/
8
8
  [semver]: https://semver.org/
9
9
 
10
+ ## 10.3.0
11
+
12
+ ### Fixed
13
+
14
+ - **Analytics events carried no user unless the app called `identify()`.**
15
+ Nothing errored when it never did, so every event landed anonymous and
16
+ retention, funnels and per-user analysis were quietly worthless — found in
17
+ a real project as 53 events, 8 registered users, and not one event carrying
18
+ a user id. The SDK already knows who is signed in; it now says so. The
19
+ Flutter SDK fixed this in 11.2.0 and the TypeScript SDKs did not, until now.
20
+
21
+ `identify()` still wins for an app with its own identity system, and
22
+ `reset()` releases that override and falls back to the Koolbase session.
23
+
24
+ If you have been calling `identify()` yourself, nothing changes. If you have
25
+ not, your events will start carrying users — which is the point, though it
26
+ means your analytics before and after this version are not comparable.
27
+
10
28
  ## 10.2.0
11
29
 
12
30
  ### Added
package/dist/cjs/index.js CHANGED
@@ -56,7 +56,7 @@ exports.Koolbase = {
56
56
  const deviceId = await (0, core_1.getOrCreateDeviceId)();
57
57
  _flags = new core_1.KoolbaseFlags(config, deviceId);
58
58
  if (config.analyticsEnabled !== false) {
59
- _analytics = new core_1.KoolbaseAnalytics(config);
59
+ _analytics = new core_1.KoolbaseAnalytics(config, () => _auth?.currentUser?.id ?? null);
60
60
  await _analytics.init(config.appVersion);
61
61
  }
62
62
  _initialized = true;
package/dist/esm/index.js CHANGED
@@ -37,7 +37,7 @@ export const Koolbase = {
37
37
  const deviceId = await getOrCreateDeviceId();
38
38
  _flags = new KoolbaseFlags(config, deviceId);
39
39
  if (config.analyticsEnabled !== false) {
40
- _analytics = new KoolbaseAnalytics(config);
40
+ _analytics = new KoolbaseAnalytics(config, () => _auth?.currentUser?.id ?? null);
41
41
  await _analytics.init(config.appVersion);
42
42
  }
43
43
  _initialized = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koolbase/js",
3
- "version": "10.2.0",
3
+ "version": "10.3.0",
4
4
  "description": "Koolbase SDK for the browser \u2014 auth, database, storage, realtime, functions, flags and offline sync in one package.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/koolbase/koolbase-react-native"
26
26
  },
27
27
  "dependencies": {
28
- "@koolbase/core": "10.2.0"
28
+ "@koolbase/core": "10.3.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"