@movmo_app/react-common 0.15.0 → 0.16.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.d.ts CHANGED
@@ -345,7 +345,14 @@ export declare interface ModalProps {
345
345
 
346
346
  /** Typed client for every Movmo sign-in and passkey-management call. */
347
347
  export declare interface MovmoAuthApi {
348
- login(email: string): Promise<MovmoLoginResponse>;
348
+ /**
349
+ * `POST /v1/auth/login`. `deferCode` sends `defer_code: true`: an unenrolled
350
+ * email's flow is created without sending a code (`sendCode` releases the
351
+ * first send); used by the partner iframe.
352
+ */
353
+ login(email: string, opts?: {
354
+ deferCode?: boolean;
355
+ }): Promise<MovmoLoginResponse>;
349
356
  sendCode(flowId: string): Promise<MovmoCodeFlow>;
350
357
  /**
351
358
  * `POST /v1/auth/recovery {flow_id, time_zone?}`: starts account recovery for
@@ -391,10 +398,19 @@ export declare interface MovmoSignIn {
391
398
  recoveryAvailable: boolean;
392
399
  /** Recovery step: the server refused recovery (`recovery_blocked`); terminal, only Close remains. */
393
400
  recoveryBlocked: boolean;
401
+ /**
402
+ * Framed passkeys: the browser won't run the passkey ceremony in this frame
403
+ * (`topOrigin_required`, or remembered). The passkey step offers `continueTopLevel`.
404
+ */
405
+ topLevelRequired: boolean;
406
+ /** Framed window with `framedPasskeys`: the passkey step always offers "Continue in a new window". */
407
+ framedPasskeys: boolean;
394
408
  liveMessage: string;
395
409
  submitEmail(): void;
396
410
  signInWithPasskey(): void;
397
411
  retryPasskey(): void;
412
+ /** Passkey step, `topLevelRequired`: calls `onContinueTopLevel` synchronously (inside the click). */
413
+ continueTopLevel(): void;
398
414
  /** Passkey step: "I can't use my passkey" → the recovery step (aborts the ceremony). No-op on re-auth. */
399
415
  cantUsePasskey(): void;
400
416
  /** Recovery step: `POST /v1/auth/recovery`, then the code step. */
@@ -791,6 +807,11 @@ export declare const signInCopy: {
791
807
  readonly passkeyUnavailable: "This browser couldn't use a passkey. Choose 'I can't use my passkey' to sign in with a code.";
792
808
  readonly discoverableNotRecognized: "That passkey isn't recognized. Continue with your email instead.";
793
809
  readonly recoveryStarted: "Sign in without your passkey";
810
+ /** Framed passkeys (MOVMO-686): the browser won't run the passkey ceremony inside the frame. */
811
+ readonly topLevelRequired: "Your browser needs a separate window to use your passkey.";
812
+ readonly continueTopLevel: "Continue in a new window";
813
+ /** Framed passkeys: any browser-side failure; never points a framed user at account recovery first. */
814
+ readonly framedPasskeyFailed: "Your passkey didn't work here. Try again, or continue in a new window.";
794
815
  readonly recoveryBlocked: "We can't recover this account right now";
795
816
  };
796
817
 
@@ -938,6 +959,36 @@ export declare interface UseMovmoSignInOptions {
938
959
  */
939
960
  expectedUserId?: string;
940
961
  promptSurface?: 'modal' | 'connect';
962
+ /**
963
+ * A framed window may run the email-first passkey `get()` (the embedding SDK
964
+ * granted `publickey-credentials-get` on the iframe). Default false. Never
965
+ * enables autofill, the passkey button, enrollment or `create()`.
966
+ */
967
+ framedPasskeys?: boolean;
968
+ /**
969
+ * The `/v1/auth/login` response the app already obtained, expected from
970
+ * `api.login(email, { deferCode: true })`: adopted on mount instead of asking
971
+ * for an email. `next:"passkey"` runs the ceremony at once (the app must call
972
+ * within the click's transient activation, ~5 s); `next:"code"` sends the first
973
+ * code (`/v1/auth/code` on the deferred flow) and shows the code step. The
974
+ * email comes from `initialEmail` / `lockedEmail`. `api.login` is not called.
975
+ */
976
+ resumeLogin?: MovmoLoginResponse;
977
+ /**
978
+ * `continueTopLevel()` calls this synchronously (the app opens its popup
979
+ * inside the click; nothing may `await` before it) with the flow's current
980
+ * email, the one the ceremony ran for (it may differ from `initialEmail`
981
+ * after an email change).
982
+ */
983
+ onContinueTopLevel?: (email: string) => void;
984
+ /**
985
+ * With `resumeLogin`: the passkey/code step's "Change" calls this instead of showing the
986
+ * hook's own email step, and the host owns the email change. That step
987
+ * calls `api.login` without `deferCode`, which would send a code at once and
988
+ * sign a code user in inside the frame, bypassing the host's popup rule.
989
+ * Without `resumeLogin` or without this, behaviour is unchanged.
990
+ */
991
+ onChangeEmail?: () => void;
941
992
  }
942
993
 
943
994
  export declare const validateEmail: (email: string) => boolean;