@sendoracloud/sdk-react-native 1.31.0 → 1.32.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 CHANGED
@@ -202,7 +202,7 @@ var Storage = class {
202
202
  // package.json
203
203
  var package_default = {
204
204
  name: "@sendoracloud/sdk-react-native",
205
- version: "1.31.0",
205
+ version: "1.32.0",
206
206
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth (incl. Game Center / Play Games), deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push-token registration and the no-arg Game Center / Play Games sign-in require a Dev Client (EAS Build or `npx expo prebuild`).",
207
207
  type: "module",
208
208
  main: "./dist/index.cjs",
package/dist/index.d.cts CHANGED
@@ -348,20 +348,27 @@ declare class CredentialInUseError extends Error {
348
348
  }
349
349
  /**
350
350
  * What a sign-in should do when the credential you present already belongs to
351
- * an account (1.30.0).
351
+ * an account.
352
352
  *
353
- * - `"adopt"` (default — and what every earlier release did unconditionally):
354
- * sign in to that account. This is the reinstall-recovery path: a Game Center
355
- * / Play Games player identity survives a reinstall server-side, so the
356
- * "collision" is usually the SAME person's earlier account. If this device is
357
- * anonymous, that anonymous account is retired — **its row is deleted** — and
358
- * `onDeviceTakeover` fires with its id.
359
- * - `"reject"`: throw `CredentialInUseError` and change nothing at all. Use it
360
- * when the local anonymous session holds progress you are not willing to
361
- * trade. Mirrors Firebase `linkWithCredential`
362
- * (`auth/credential-already-in-use`) and Supabase `linkIdentity`.
353
+ * **You usually want the default — omit this.** Since 1.32.0 the default is
354
+ * safe by construction: adopt the other account silently when nothing would be
355
+ * destroyed, and refuse when something would be.
363
356
  *
364
- * `"reject"` blocks the switch; it does not merge the two accounts. To offer
357
+ * - **Fresh install / no guest session** → nothing to lose, so it adopts. This
358
+ * is the reinstall-recovery path: a Game Center / Play Games identity
359
+ * survives a reinstall server-side, so the "collision" is usually the SAME
360
+ * person's earlier account, and they get it back. Never refused.
361
+ * - **Live guest session** → adopting would retire it (**its row is deleted**
362
+ * and `onDeviceTakeover` fires). Refused with `CredentialInUseError` so you
363
+ * can ask the player instead of the SDK guessing on their behalf.
364
+ *
365
+ * Override in either direction:
366
+ *
367
+ * - `"adopt"` — always adopt, even when it deletes the guest account. This is
368
+ * what every release before 1.30.0 did unconditionally.
369
+ * - `"reject"` — always throw on a collision, even a harmless one.
370
+ *
371
+ * ⚠ A refusal blocks the switch; it does not merge the two accounts. To offer
365
372
  * "use my other account", catch the error and re-call with `"adopt"`, then
366
373
  * migrate your own data from `onDeviceTakeover`'s `retiredAnonUserId`.
367
374
  */
@@ -377,7 +384,8 @@ type GameSignInOptions = {
377
384
  link?: boolean;
378
385
  /**
379
386
  * What to do when the player identity already belongs to an account.
380
- * Default `"adopt"`. See {@link CredentialCollisionPolicy}.
387
+ * **Omit it** — the default refuses only when a live guest session would be
388
+ * deleted. See {@link CredentialCollisionPolicy}.
381
389
  */
382
390
  onCredentialInUse?: CredentialCollisionPolicy;
383
391
  };
@@ -766,9 +774,9 @@ declare class Auth {
766
774
  link?: boolean;
767
775
  /**
768
776
  * What to do if this social identity (or its verified email) already
769
- * belongs to an account. Default `"adopt"` = sign in to it, retiring this
770
- * device's anonymous account. `"reject"` throws `CredentialInUseError` and
771
- * leaves everything untouched. See {@link CredentialCollisionPolicy}.
777
+ * belongs to an account. **Omit it** — the default adopts when nothing
778
+ * would be destroyed and refuses when a live guest session would be
779
+ * deleted. See {@link CredentialCollisionPolicy}.
772
780
  */
773
781
  onCredentialInUse?: CredentialCollisionPolicy;
774
782
  }): Promise<AuthUser>;
package/dist/index.d.ts CHANGED
@@ -348,20 +348,27 @@ declare class CredentialInUseError extends Error {
348
348
  }
349
349
  /**
350
350
  * What a sign-in should do when the credential you present already belongs to
351
- * an account (1.30.0).
351
+ * an account.
352
352
  *
353
- * - `"adopt"` (default — and what every earlier release did unconditionally):
354
- * sign in to that account. This is the reinstall-recovery path: a Game Center
355
- * / Play Games player identity survives a reinstall server-side, so the
356
- * "collision" is usually the SAME person's earlier account. If this device is
357
- * anonymous, that anonymous account is retired — **its row is deleted** — and
358
- * `onDeviceTakeover` fires with its id.
359
- * - `"reject"`: throw `CredentialInUseError` and change nothing at all. Use it
360
- * when the local anonymous session holds progress you are not willing to
361
- * trade. Mirrors Firebase `linkWithCredential`
362
- * (`auth/credential-already-in-use`) and Supabase `linkIdentity`.
353
+ * **You usually want the default — omit this.** Since 1.32.0 the default is
354
+ * safe by construction: adopt the other account silently when nothing would be
355
+ * destroyed, and refuse when something would be.
363
356
  *
364
- * `"reject"` blocks the switch; it does not merge the two accounts. To offer
357
+ * - **Fresh install / no guest session** → nothing to lose, so it adopts. This
358
+ * is the reinstall-recovery path: a Game Center / Play Games identity
359
+ * survives a reinstall server-side, so the "collision" is usually the SAME
360
+ * person's earlier account, and they get it back. Never refused.
361
+ * - **Live guest session** → adopting would retire it (**its row is deleted**
362
+ * and `onDeviceTakeover` fires). Refused with `CredentialInUseError` so you
363
+ * can ask the player instead of the SDK guessing on their behalf.
364
+ *
365
+ * Override in either direction:
366
+ *
367
+ * - `"adopt"` — always adopt, even when it deletes the guest account. This is
368
+ * what every release before 1.30.0 did unconditionally.
369
+ * - `"reject"` — always throw on a collision, even a harmless one.
370
+ *
371
+ * ⚠ A refusal blocks the switch; it does not merge the two accounts. To offer
365
372
  * "use my other account", catch the error and re-call with `"adopt"`, then
366
373
  * migrate your own data from `onDeviceTakeover`'s `retiredAnonUserId`.
367
374
  */
@@ -377,7 +384,8 @@ type GameSignInOptions = {
377
384
  link?: boolean;
378
385
  /**
379
386
  * What to do when the player identity already belongs to an account.
380
- * Default `"adopt"`. See {@link CredentialCollisionPolicy}.
387
+ * **Omit it** — the default refuses only when a live guest session would be
388
+ * deleted. See {@link CredentialCollisionPolicy}.
381
389
  */
382
390
  onCredentialInUse?: CredentialCollisionPolicy;
383
391
  };
@@ -766,9 +774,9 @@ declare class Auth {
766
774
  link?: boolean;
767
775
  /**
768
776
  * What to do if this social identity (or its verified email) already
769
- * belongs to an account. Default `"adopt"` = sign in to it, retiring this
770
- * device's anonymous account. `"reject"` throws `CredentialInUseError` and
771
- * leaves everything untouched. See {@link CredentialCollisionPolicy}.
777
+ * belongs to an account. **Omit it** — the default adopts when nothing
778
+ * would be destroyed and refuses when a live guest session would be
779
+ * deleted. See {@link CredentialCollisionPolicy}.
772
780
  */
773
781
  onCredentialInUse?: CredentialCollisionPolicy;
774
782
  }): Promise<AuthUser>;
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.31.0",
160
+ version: "1.32.0",
161
161
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth (incl. Game Center / Play Games), deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push-token registration and the no-arg Game Center / Play Games sign-in require a Dev Client (EAS Build or `npx expo prebuild`).",
162
162
  type: "module",
163
163
  main: "./dist/index.cjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoracloud/sdk-react-native",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "Sendora Cloud React Native + Expo SDK — analytics, identity, push-token registration, auth (incl. Game Center / Play Games), deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push-token registration and the no-arg Game Center / Play Games sign-in require a Dev Client (EAS Build or `npx expo prebuild`).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",