@koolbase/react-native 12.8.0 → 12.9.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/dist/cjs/index.js CHANGED
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- // @koolbase/react-native — composes @koolbase/core for a React Native host.
3
- //
4
- // Everything the core exports is re-exported here unchanged, so an app that
5
- // installed this package before the split sees the same surface. What this
6
- // file adds is the composition: one Koolbase singleton, initialized with the
7
- // React Native platform adapter and keychain-backed session storage.
8
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
3
  if (k2 === undefined) k2 = k;
10
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -21,6 +15,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
15
  };
22
16
  Object.defineProperty(exports, "__esModule", { value: true });
23
17
  exports.useRecord = exports.useCollection = exports.SecureAuthStorage = exports.Koolbase = exports.reactNativePlatform = void 0;
18
+ const react_native_1 = require("react-native");
19
+ // @koolbase/react-native — composes @koolbase/core for a React Native host.
20
+ //
21
+ // Everything the core exports is re-exported here unchanged, so an app that
22
+ // installed this package before the split sees the same surface. What this
23
+ // file adds is the composition: one Koolbase singleton, initialized with the
24
+ // React Native platform adapter and keychain-backed session storage.
24
25
  __exportStar(require("@koolbase/core"), exports);
25
26
  var platform_js_1 = require("./platform.js");
26
27
  Object.defineProperty(exports, "reactNativePlatform", { enumerable: true, get: function () { return platform_js_1.reactNativePlatform; } });
@@ -70,7 +71,10 @@ exports.Koolbase = {
70
71
  // app catching KoolbaseUnauthenticatedError is already signed out and can
71
72
  // route to login, rather than looping on a dead token.
72
73
  async () => { await _auth?.clearStoredSession(); });
73
- _storage = new core_1.KoolbaseStorage(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
74
+ _storage = new core_1.KoolbaseStorage(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); },
75
+ // Project identity for publicUrlFor, from the bootstrap payload; a
76
+ // missing one nudges a refresh (as Flutter's storage client).
77
+ () => _flags?.projectId() ?? '', () => { void _flags?.refresh(); });
74
78
  _fiscal = new core_1.KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
75
79
  _realtime = new core_1.KoolbaseRealtime(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), () => _auth?.currentUser?.id ?? null);
76
80
  _functions = new core_1.KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
@@ -78,6 +82,9 @@ exports.Koolbase = {
78
82
  // (code push), and registration keying (messaging) must all agree on it.
79
83
  const deviceId = await (0, core_1.getOrCreateDeviceId)();
80
84
  _flags = new core_1.KoolbaseFlags(config, deviceId);
85
+ // The bootstrap payload (flags, config, version policy, project identity),
86
+ // fetched in the background as Flutter's SDK does: never blocks startup.
87
+ void _flags.koolbaseFetch(config.appVersion ?? '0.0.0', react_native_1.Platform.OS);
81
88
  // Initialize analytics
82
89
  // Opt-in: nothing is sent unless the app asks for it.
83
90
  if (config.analyticsEnabled === true) {
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { Platform } from 'react-native';
1
2
  // @koolbase/react-native — composes @koolbase/core for a React Native host.
2
3
  //
3
4
  // Everything the core exports is re-exported here unchanged, so an app that
@@ -52,7 +53,10 @@ export const Koolbase = {
52
53
  // app catching KoolbaseUnauthenticatedError is already signed out and can
53
54
  // route to login, rather than looping on a dead token.
54
55
  async () => { await _auth?.clearStoredSession(); });
55
- _storage = new KoolbaseStorage(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
56
+ _storage = new KoolbaseStorage(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); },
57
+ // Project identity for publicUrlFor, from the bootstrap payload; a
58
+ // missing one nudges a refresh (as Flutter's storage client).
59
+ () => _flags?.projectId() ?? '', () => { void _flags?.refresh(); });
56
60
  _fiscal = new KoolbaseFiscal(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
57
61
  _realtime = new KoolbaseRealtime(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), () => _auth?.currentUser?.id ?? null);
58
62
  _functions = new KoolbaseFunctions(config, () => _auth?.validAccessToken() ?? Promise.resolve(null), async () => { await _auth?.clearStoredSession(); });
@@ -60,6 +64,9 @@ export const Koolbase = {
60
64
  // (code push), and registration keying (messaging) must all agree on it.
61
65
  const deviceId = await getOrCreateDeviceId();
62
66
  _flags = new KoolbaseFlags(config, deviceId);
67
+ // The bootstrap payload (flags, config, version policy, project identity),
68
+ // fetched in the background as Flutter's SDK does: never blocks startup.
69
+ void _flags.koolbaseFetch(config.appVersion ?? '0.0.0', Platform.OS);
63
70
  // Initialize analytics
64
71
  // Opt-in: nothing is sent unless the app asks for it.
65
72
  if (config.analyticsEnabled === true) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koolbase/react-native",
3
- "version": "12.8.0",
4
- "description": "React Native SDK for Koolbase — auth, database, storage, realtime, feature flags, and functions in one package.",
3
+ "version": "12.9.0",
4
+ "description": "React Native SDK for Koolbase \u2014 auth, database, storage, realtime, feature flags, and functions in one package.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
7
7
  "files": [
@@ -24,7 +24,7 @@
24
24
  "url": "https://github.com/koolbase/koolbase-react-native"
25
25
  },
26
26
  "dependencies": {
27
- "@koolbase/core": "12.8.0"
27
+ "@koolbase/core": "12.9.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@react-native-async-storage/async-storage": "^2.2.0 || ^3.0.2",