@sendoracloud/sdk-react-native 1.18.0 → 1.19.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/index.cjs +32 -1
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +32 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -200,7 +200,7 @@ var Storage = class {
|
|
|
200
200
|
// package.json
|
|
201
201
|
var package_default = {
|
|
202
202
|
name: "@sendoracloud/sdk-react-native",
|
|
203
|
-
version: "1.
|
|
203
|
+
version: "1.19.0",
|
|
204
204
|
description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
|
|
205
205
|
type: "module",
|
|
206
206
|
main: "./dist/index.cjs",
|
|
@@ -2358,6 +2358,37 @@ var SendoraSDK = class {
|
|
|
2358
2358
|
getUserId() {
|
|
2359
2359
|
return this.userId;
|
|
2360
2360
|
}
|
|
2361
|
+
/**
|
|
2362
|
+
* Non-throwing, synchronous read of the verified auth principal. Returns
|
|
2363
|
+
* the persisted `AuthUser` (`{ id, email, emailVerified, name, isAnonymous }`)
|
|
2364
|
+
* or `null` when no session is hydrated yet. Zero I/O — a pure in-memory read
|
|
2365
|
+
* of the session restored during `init()` — so it is safe on the very first
|
|
2366
|
+
* API call at cold start: await `init()` once (disk-only, no network), then
|
|
2367
|
+
* read this synchronously, even offline.
|
|
2368
|
+
*
|
|
2369
|
+
* `id` is the JWT `sub` — the durable, server-verified identity to key your
|
|
2370
|
+
* backend data on. Do NOT use `getAnonymousIdSync()` for that (it's a
|
|
2371
|
+
* rotating analytics id). Pair with `isReady()` to tell "still restoring"
|
|
2372
|
+
* apart from "signed out": `null` here while `isReady()` is `false` = init
|
|
2373
|
+
* hasn't finished; `null` while `isReady()` is `true` = genuinely no session.
|
|
2374
|
+
* `isAnonymous` is optional on the wire — test `=== false`, not truthiness.
|
|
2375
|
+
* The access token is re-verified server-side, so reading identity here
|
|
2376
|
+
* (client-untrusted) for UI/routing is safe; never use it as your own
|
|
2377
|
+
* authorization decision.
|
|
2378
|
+
*/
|
|
2379
|
+
getUserSync() {
|
|
2380
|
+
return this.ready ? this.auth.getCurrentUser() : null;
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* Non-throwing, synchronous readiness flag. `true` once `init()` has
|
|
2384
|
+
* resolved (storage hydrated + auth session restored). Gate a cold-start
|
|
2385
|
+
* identity read on this so you never mistake "still restoring the session"
|
|
2386
|
+
* for "signed out" — the loading gate every mobile auth SDK expects
|
|
2387
|
+
* (Firebase's init-null caveat, Clerk's `isLoaded`).
|
|
2388
|
+
*/
|
|
2389
|
+
isReady() {
|
|
2390
|
+
return this.ready;
|
|
2391
|
+
}
|
|
2361
2392
|
/** Toggle consent at runtime — when false, events drop instead of fire. */
|
|
2362
2393
|
setConsent(granted) {
|
|
2363
2394
|
this.consentGranted = granted;
|
package/dist/index.d.cts
CHANGED
|
@@ -985,6 +985,33 @@ declare class SendoraSDK {
|
|
|
985
985
|
getAnonymousIdSync(): string | null;
|
|
986
986
|
/** Current identified user id, if any. */
|
|
987
987
|
getUserId(): string | null;
|
|
988
|
+
/**
|
|
989
|
+
* Non-throwing, synchronous read of the verified auth principal. Returns
|
|
990
|
+
* the persisted `AuthUser` (`{ id, email, emailVerified, name, isAnonymous }`)
|
|
991
|
+
* or `null` when no session is hydrated yet. Zero I/O — a pure in-memory read
|
|
992
|
+
* of the session restored during `init()` — so it is safe on the very first
|
|
993
|
+
* API call at cold start: await `init()` once (disk-only, no network), then
|
|
994
|
+
* read this synchronously, even offline.
|
|
995
|
+
*
|
|
996
|
+
* `id` is the JWT `sub` — the durable, server-verified identity to key your
|
|
997
|
+
* backend data on. Do NOT use `getAnonymousIdSync()` for that (it's a
|
|
998
|
+
* rotating analytics id). Pair with `isReady()` to tell "still restoring"
|
|
999
|
+
* apart from "signed out": `null` here while `isReady()` is `false` = init
|
|
1000
|
+
* hasn't finished; `null` while `isReady()` is `true` = genuinely no session.
|
|
1001
|
+
* `isAnonymous` is optional on the wire — test `=== false`, not truthiness.
|
|
1002
|
+
* The access token is re-verified server-side, so reading identity here
|
|
1003
|
+
* (client-untrusted) for UI/routing is safe; never use it as your own
|
|
1004
|
+
* authorization decision.
|
|
1005
|
+
*/
|
|
1006
|
+
getUserSync(): AuthUser | null;
|
|
1007
|
+
/**
|
|
1008
|
+
* Non-throwing, synchronous readiness flag. `true` once `init()` has
|
|
1009
|
+
* resolved (storage hydrated + auth session restored). Gate a cold-start
|
|
1010
|
+
* identity read on this so you never mistake "still restoring the session"
|
|
1011
|
+
* for "signed out" — the loading gate every mobile auth SDK expects
|
|
1012
|
+
* (Firebase's init-null caveat, Clerk's `isLoaded`).
|
|
1013
|
+
*/
|
|
1014
|
+
isReady(): boolean;
|
|
988
1015
|
/** Toggle consent at runtime — when false, events drop instead of fire. */
|
|
989
1016
|
setConsent(granted: boolean): void;
|
|
990
1017
|
/** Associate a user id + traits with the current anonymous install. */
|
package/dist/index.d.ts
CHANGED
|
@@ -985,6 +985,33 @@ declare class SendoraSDK {
|
|
|
985
985
|
getAnonymousIdSync(): string | null;
|
|
986
986
|
/** Current identified user id, if any. */
|
|
987
987
|
getUserId(): string | null;
|
|
988
|
+
/**
|
|
989
|
+
* Non-throwing, synchronous read of the verified auth principal. Returns
|
|
990
|
+
* the persisted `AuthUser` (`{ id, email, emailVerified, name, isAnonymous }`)
|
|
991
|
+
* or `null` when no session is hydrated yet. Zero I/O — a pure in-memory read
|
|
992
|
+
* of the session restored during `init()` — so it is safe on the very first
|
|
993
|
+
* API call at cold start: await `init()` once (disk-only, no network), then
|
|
994
|
+
* read this synchronously, even offline.
|
|
995
|
+
*
|
|
996
|
+
* `id` is the JWT `sub` — the durable, server-verified identity to key your
|
|
997
|
+
* backend data on. Do NOT use `getAnonymousIdSync()` for that (it's a
|
|
998
|
+
* rotating analytics id). Pair with `isReady()` to tell "still restoring"
|
|
999
|
+
* apart from "signed out": `null` here while `isReady()` is `false` = init
|
|
1000
|
+
* hasn't finished; `null` while `isReady()` is `true` = genuinely no session.
|
|
1001
|
+
* `isAnonymous` is optional on the wire — test `=== false`, not truthiness.
|
|
1002
|
+
* The access token is re-verified server-side, so reading identity here
|
|
1003
|
+
* (client-untrusted) for UI/routing is safe; never use it as your own
|
|
1004
|
+
* authorization decision.
|
|
1005
|
+
*/
|
|
1006
|
+
getUserSync(): AuthUser | null;
|
|
1007
|
+
/**
|
|
1008
|
+
* Non-throwing, synchronous readiness flag. `true` once `init()` has
|
|
1009
|
+
* resolved (storage hydrated + auth session restored). Gate a cold-start
|
|
1010
|
+
* identity read on this so you never mistake "still restoring the session"
|
|
1011
|
+
* for "signed out" — the loading gate every mobile auth SDK expects
|
|
1012
|
+
* (Firebase's init-null caveat, Clerk's `isLoaded`).
|
|
1013
|
+
*/
|
|
1014
|
+
isReady(): boolean;
|
|
988
1015
|
/** Toggle consent at runtime — when false, events drop instead of fire. */
|
|
989
1016
|
setConsent(granted: boolean): void;
|
|
990
1017
|
/** Associate a user id + traits with the current anonymous install. */
|
package/dist/index.js
CHANGED
|
@@ -157,7 +157,7 @@ var Storage = class {
|
|
|
157
157
|
// package.json
|
|
158
158
|
var package_default = {
|
|
159
159
|
name: "@sendoracloud/sdk-react-native",
|
|
160
|
-
version: "1.
|
|
160
|
+
version: "1.19.0",
|
|
161
161
|
description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
|
|
162
162
|
type: "module",
|
|
163
163
|
main: "./dist/index.cjs",
|
|
@@ -2320,6 +2320,37 @@ var SendoraSDK = class {
|
|
|
2320
2320
|
getUserId() {
|
|
2321
2321
|
return this.userId;
|
|
2322
2322
|
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Non-throwing, synchronous read of the verified auth principal. Returns
|
|
2325
|
+
* the persisted `AuthUser` (`{ id, email, emailVerified, name, isAnonymous }`)
|
|
2326
|
+
* or `null` when no session is hydrated yet. Zero I/O — a pure in-memory read
|
|
2327
|
+
* of the session restored during `init()` — so it is safe on the very first
|
|
2328
|
+
* API call at cold start: await `init()` once (disk-only, no network), then
|
|
2329
|
+
* read this synchronously, even offline.
|
|
2330
|
+
*
|
|
2331
|
+
* `id` is the JWT `sub` — the durable, server-verified identity to key your
|
|
2332
|
+
* backend data on. Do NOT use `getAnonymousIdSync()` for that (it's a
|
|
2333
|
+
* rotating analytics id). Pair with `isReady()` to tell "still restoring"
|
|
2334
|
+
* apart from "signed out": `null` here while `isReady()` is `false` = init
|
|
2335
|
+
* hasn't finished; `null` while `isReady()` is `true` = genuinely no session.
|
|
2336
|
+
* `isAnonymous` is optional on the wire — test `=== false`, not truthiness.
|
|
2337
|
+
* The access token is re-verified server-side, so reading identity here
|
|
2338
|
+
* (client-untrusted) for UI/routing is safe; never use it as your own
|
|
2339
|
+
* authorization decision.
|
|
2340
|
+
*/
|
|
2341
|
+
getUserSync() {
|
|
2342
|
+
return this.ready ? this.auth.getCurrentUser() : null;
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* Non-throwing, synchronous readiness flag. `true` once `init()` has
|
|
2346
|
+
* resolved (storage hydrated + auth session restored). Gate a cold-start
|
|
2347
|
+
* identity read on this so you never mistake "still restoring the session"
|
|
2348
|
+
* for "signed out" — the loading gate every mobile auth SDK expects
|
|
2349
|
+
* (Firebase's init-null caveat, Clerk's `isLoaded`).
|
|
2350
|
+
*/
|
|
2351
|
+
isReady() {
|
|
2352
|
+
return this.ready;
|
|
2353
|
+
}
|
|
2323
2354
|
/** Toggle consent at runtime — when false, events drop instead of fire. */
|
|
2324
2355
|
setConsent(granted) {
|
|
2325
2356
|
this.consentGranted = granted;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendoracloud/sdk-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Sendora Cloud React Native + Expo SDK — analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|