ParaManager Class
TheParaManager class is the central component for managing user authentication, wallet operations, and session state.
Properties
An array of
Wallet objects currently associated with the authenticated user. This list is updated after operations like fetchWallets() or createWallet().The current session state of the Para SDK:
.unknown, .inactive, .restoring (a saved session is being restored at launch), .active, or .activeLoggedIn.Indicates if the
ParaManager and its underlying WebView are initialized and ready to process requests.Initialization
Authentication Methods
Signs a user up or in with their email or phone and runs the whole flow to an authenticated session, including wallet creation. Recommended for new integrations. Every email or phone sign-in starts on a Para-hosted code page; a returning passkey account is then handed back for the native passkey prompt.
verificationCodeProvider is still required, but isn’t called while every sign-in starts on that page. Throws if a user is already signed in (call logout() first), if the user cancels a Para-hosted page (ParaError.error("Authentication cancelled")) or passkey prompt, if verification fails, or if the user picks a passkey that belongs to a different account. When Para’s updated authentication flow isn’t running for your app, it throws ParaTwoFactorRequiredError for an account that must complete login 2FA. See the Email & Phone Login guide.Starts the stage-based authentication (signup or login) process for a user with the specified email or phone number. When a
WebAuthenticationSession is available (passed in or registered via setDefaultWebAuthenticationSession(_:)), hosted Para One Click flows are handled automatically and the returned state’s stage will be .done. The stage-based methods always use the code-entry flow; prefer authenticateWithEmailOrPhone for new integrations.Stores a
WebAuthenticationSession that the SDK reuses for hosted login, signup, and OAuth flows.Checks if a specific signup method (passkey or password) is available based on the current
AuthState.Completes the signup process for a new, verified user using the chosen method (passkey or password). This creates the passkey or password and then creates the user’s required wallets, so you don’t need to call
synchronizeRequiredWallets() afterward.Logs in an existing user, automatically determining and using the preferred available method (passkey or password).
Generates and registers a new passkey for the user. Typically called during signup when
authState.stage == .signup and SignupMethod.passkey is chosen.Presents a Para-hosted page (for example
authState.loginUrl) in a web authentication session. Throws if no session is available or the user cancels.Signs a user up or in with an OAuth provider and runs the whole flow to an authenticated session. Recommended for new integrations. Works on both Para sign-in experiences: on Para’s updated authentication flow the provider sign-in runs on a Para-hosted page, then a new user creates their first credential (a native passkey when your app offers passkeys, otherwise a password or PIN on a Para-hosted page) and a returning passkey user signs in with their native passkey. Otherwise it runs the same flow as
handleOAuth. Throws if no WebAuthenticationSession is available, if the user cancels the sheet or passkey prompt, if the user picks a passkey that belongs to a different account, or, on Para’s updated authentication flow, if a user is already signed in (call logout() first). When Para’s updated authentication flow isn’t running for your app, it throws ParaTwoFactorRequiredError for an account that must complete login 2FA. See the Social Login guide.Initiates and handles the entire OAuth flow with the specified provider (e.g., Google, Apple, Discord).
This includes user authentication with the provider, Para account lookup/creation, and passkey setup if it’s a new Para user. Always runs the provider-then-passkey flow; prefer
authenticateWithOAuth for new integrations.Signs a user in to Para with an external wallet they control. Recommended for new integrations. On Para’s updated authentication flow it asks
signMessage (or signCosmosMessage for a Cosmos wallet) to sign a sign-in message with the wallet (Sign-In With Ethereum for EVM, plain text for other chains) and verifies the signature. Supports EVM, Solana, and Cosmos wallets; Stellar isn’t supported yet. This is a verify-only sign-in: every account, new or returning, is signed in once the signature is verified, no embedded Para wallet is created, and the session can’t sign with any embedded Para wallets the account already has. Otherwise it runs loginExternalWallet(wallet:) with isConnectionOnly: false, which doesn’t ask for a signature. On both flows an active connection-only session (for example from MetaMaskConnector.connect()) is logged out first. Throws if a signing closure throws, if the signature can’t be verified, or, on Para’s updated authentication flow, if a user is already signed in to a Para account (call logout() first) or a Cosmos wallet is passed without signCosmosMessage. When Para’s updated authentication flow isn’t running for your app, it throws ParaTwoFactorRequiredError for an account that must complete login 2FA. See the External Wallets guide.Logs into Para using an externally managed wallet (e.g., MetaMask) without asking the wallet for a signature. With
isConnectionOnly: true (the ExternalWalletInfo default) it starts a connection-only session; pass false to sign in to a Para account. Prefer authenticateWithExternalWallet for new integrations.Session Management Methods
Checks if there is an active session and the user is fully authenticated (e.g., passkey/password set up).
Checks if there is any active session with Para, even if the user is not fully logged in (e.g., pending verification).
Manually checks and updates the current session state. This method waits for the Para WebView to be ready and updates the session state accordingly.
Wallet Management Methods
Creates a new wallet for the authenticated user. This method initiates wallet creation and refreshes the internal
wallets list. Observe the paraManager.wallets property for the new wallet.Retrieves the email of the currently authenticated user, if available and the session was initiated with an email.
(Advanced) Distributes a new share for an existing wallet.
Gets the balance for any wallet type. This unified method works with all wallet types (EVM, Solana, Cosmos).
Synchronizes required wallets by creating any missing non-optional wallet types. You usually don’t need to call this:
authenticateWithEmailOrPhone, handleSignup, hosted One Click signup, and handleOAuth already create a new user’s required wallets. Call it only if your integration needs to create wallet types that are still missing, for example after you add a required wallet type for existing users.Transfer Methods
Transfers tokens using an EVM wallet. This method builds, signs, and broadcasts the transaction in one call.
Signing Methods
Signs a transaction object using the specified wallet. The method accepts any Encodable transaction type (EVMTransaction, SolanaTransaction, CosmosTransaction) and handles chain-specific formatting internally.
For EVM transactions, the returned
SignatureResult contains the complete RLP-encoded transaction ready for broadcasting via eth_sendRawTransaction.Signs an RLP-encoded EVM transaction string using the private key of the specified wallet. This method is maintained for backward compatibility.
Two-Factor Authentication (2FA) Methods
Enables 2FA for the user after they have scanned the URI and entered the code from their authenticator app.
MetaMaskConnector Class
TheMetaMaskConnector class enables integration with MetaMask wallet for external wallet operations and authentication.
Properties
The current chain ID from MetaMask (e.g., “0x1” for Ethereum mainnet, “0xaa36a7” for Sepolia).
Initialization
Methods
Initiates connection to MetaMask and requests account access. This method is
async throws. Upon successful connection, the accounts, chainId, and isConnected properties of the MetaMaskConnector instance are updated. ParaManager.loginExternalWallet is also called internally with the connected address, which starts a connection-only session. Call ParaManager.authenticateWithExternalWallet afterward to sign the user in to Para.Error Types
Thrown by the stage-based sign-in methods (
initiateAuthFlow, handleVerificationCode, handleOAuth, and loginExternalWallet) when the account must complete login two-factor authentication, which those flows can’t host. The SDK cancels the pending sign-in first. The authenticate methods throw it too when Para’s updated authentication flow isn’t running for your app; on the updated flow they complete the second factor on a Para-hosted page. A separate type rather than a ParaError case, so existing switch statements over ParaError keep compiling. mode (.verify or .enroll, or nil when Para didn’t say) tells you whether the account must verify an enrolled second factor or set one up, and methods lists the second-factor methods Para offered.CosmosChain
CosmosSigningMethod
CosmosTransaction
CosmosSignResponse
CosmosCoin
CosmosFee
Type Definitions
SignatureResult
AuthState
AuthenticationResult
The result of
authenticateWithEmailOrPhone, authenticateWithOAuth, and authenticateWithExternalWallet.CosmosSignedMessage
A Cosmos wallet’s signature over the sign-in message, returned from
signCosmosMessage in authenticateWithExternalWallet. Create it with CosmosSignedMessage(signature:signer:publicKeyHex:).