Skip to main content

ParaMobile Class

The ParaMobile class is the React Native implementation of the Para SDK. It extends the core Para client, so methods such as authenticateWithEmailOrPhone, onStatePhaseChange, and logout work as documented in the guides. This page covers the methods ParaMobile adds or changes for native apps.

Constructor

Function
Creates an instance of ParaMobile. Call it as new ParaMobile(apiKey, relyingPartyId?, opts?), or pass the Environment first when your API key has no environment prefix: new ParaMobile(env, apiKey, relyingPartyId?, opts?).

Authentication Methods

Function
Signs a user up or in with an OAuth provider and resolves once the user has an active session and wallets. Pass redirectCallbacks.onOAuthUrl and open the URL it receives in your in-app browser. On Para’s updated authentication flow the URL is a Para-hosted page that runs the provider sign-in, so also pass appScheme; onOAuthUrl is required there. While the call is pending, a new user creates their first credential once authStateInfo.isCredentialSetup is true: a passkey with registerPasskey(authStateInfo.passkeyId), or a password or PIN on the Para-hosted passwordUrl or pinUrl your app opens. A returning passkey user signs in with loginWithPasskey after onPasskeyLoginRequired fires. See Social Login.
Function
Signs a user up or in with their email or phone and resolves once the user has an active session and wallets. Your app opens the Para-hosted pages it publishes through onStatePhaseChange: the verification page, and for a new user without a passkey the password or PIN page. On Para’s updated authentication flow it also watches for a returning passkey user handed back by a Para-hosted page and fires onPasskeyLoginRequired. See Email & Phone Login.
Function
Starts a sign-in (or connection) with an external wallet. Without the opt-in it returns an auth state whose signatureVerificationMessage you sign and pass to verifyExternalWallet. On Para’s updated authentication flow it opens a verify-only sign-in that you finish with completeExternalWalletLogin; a wallet that sets withFullParaAuth is rejected with Full-auth external wallet sign-in is not supported on React Native auth v2 (“auth v2” in the message means the updated flow). See External Wallet Login.
Function
Finishes an external wallet sign-in on Para’s updated authentication flow, started with loginExternalWallet. Your signMessage callback signs the sign-in message with the same wallet, and the call resolves once the user is signed in. The sign-in is verify-only: it proves the wallet’s address and asks for no passkey, password, PIN, or Para-hosted page, for new and returning accounts alike. Throws if no external wallet sign-in is waiting for a signature, and cancels the sign-in on any failure.
Function
Finishes an external wallet sign-in without the opt-in, with the signed signatureVerificationMessage. On Para’s updated authentication flow it throws while a sign-in is waiting for its signature; use completeExternalWalletLogin instead.

Passkey Methods

Function
Resolves to true when the device supports native passkeys.
Function
Creates a native passkey for a new user. Pass the passkeyId from authStateInfo (or, on today’s stage-based flow, the signup auth state). On Para’s updated authentication flow, call it once authStateInfo.isCredentialSetup is true and passkeyId is set; the pending sign-in then continues to wallet creation.
Function
Signs in a returning user with their native passkey. On Para’s updated authentication flow, call it when onPasskeyLoginRequired fires: the user has entered their email or phone code (or finished OAuth) on a Para-hosted page, and the passkey must belong to the account that signed in there. Don’t call it before the code based on hasPasskey: sign-in doesn’t say whether an account exists or has a passkey until the code is entered. Without the opt-in, call it when the Para-hosted page returns to your nativeCallbackUrl with status=PASSKEY_REQUIRED. If it fails during a sign-in, it cancels that sign-in so the pending call rejects.
Function
On Para’s updated authentication flow, subscribes to the moment a pending sign-in needs the user’s native passkey. A Para-hosted page can’t use a passkey bound to your app, so it returns the user to your app and the listener fires. Close the in-app browser if it’s still open and call loginWithPasskey(). Fires at most once per sign-in.

Other Methods

Function
Sets a handler for transaction review URLs. When a signing operation needs the user’s approval (for example because of a permissions policy), the SDK calls the handler with the review URL. Open it in your in-app browser.
Function
Forwards a message from a WebView that shows a Para-hosted page (for example Telegram or Farcaster sign-in) to the SDK. Call it from the WebView’s onMessage callback. See Social Login.