@getpara/web-sdk client directly — no React required. This approach works with any JavaScript framework (Vue, Svelte, Angular, etc.) or plain vanilla JS.
Available in v2.13.0+
While these methods manage the flow end-to-end, you are responsible for opening the portal URLs that Para generates during authentication (for verification, passkey creation, password entry, etc.). Use
para.onStatePhaseChange() to listen for these URLs and open them. Passkey URLs must be opened in a popup — WebAuthn does not work in iframes. See Handling State Changes below.Prerequisites
Install the Web SDK:Client Setup
Create a Para client instance:Method Reference
This method must be paired with
para.onStatePhaseChange() to open the Para-hosted pages that appear during authentication: the code page (verificationUrl), a returning user’s passkey page, and, for a new account, the passkey, password, or PIN creation pages. See the guide for your platform for the full state listener pattern.On Para’s updated authentication flow, the sign-in runs on a Para-hosted page published as
authStateInfo.oauthUrl (Telegram and Farcaster included). On the web, open a blank popup in the click handler before calling this method, then point it at oauthUrl from your para.onStatePhaseChange() listener. The same listener opens the passkey, password, or PIN creation page if a new account has to set one up. See the guide for your platform for the full pattern.Handling State Changes
During authentication, Para’s state machine progresses through phases that require user interaction. Each step that collects a code or a credential runs on a Para-hosted page, and Para publishes the page URL onauthStateInfo. You need to subscribe to state changes and open these pages yourself.
Use para.onStatePhaseChange() to receive a StateSnapshot. The snapshot contains authPhase (what stage the flow is in) and authStateInfo (URLs and flags for the current stage):
From web SDK 3.26.0, email and phone sign-in collects the code on the Para-hosted page at
verificationUrl. The page also resends the code on request, so you don’t build a code input or call verifyNewAccount. If the account must create its first passkey, password, or PIN, isCredentialSetup is true and the creation URLs appear after the code step, often without a phase change. The simplified method keeps waiting until the user finishes.Keep the portal window connected to your app. The portal can only close its window when it finishes if it can reach the window that opened it.
- Open portal URLs with
window.open(url, name, "popup,...")as shown above, not atarget="_blank"link ornoopener. - If your app sends a
Cross-Origin-Opener-Policyheader, usesame-origin-allow-popups. - Don’t close the window based on
authPhase. The portal is still sending key shares and may ask the user to pick a wallet or approve permissions after the session is active. Leave it open until the portal or the user closes it. - New users may get a
passkeyUrl,passwordUrl, orpinUrlafter the code step, so keep listening until authentication completes.
authStateInfo Fields
State Phase Reference
TheStateSnapshot returned by para.onStatePhaseChange() contains three phase fields that tell you where in the flow the user is. Use these to drive your UI.
corePhase — Top-Level Lifecycle
authPhase — Authentication Flow Detail
These phases run on Para’s updated authentication flow, for every sign-in method:
Earlier flow phases (React Native apps without supportsAuthV2)
Earlier flow phases (React Native apps without supportsAuthV2)
React Native apps that haven’t set
supportsAuthV2 run the earlier flow. Its phases replace authenticating_v2 and processing_authentication_v2:External wallet phases
External wallet phases
loginExternalWallet with a single wallet signs in through authenticating_v2 and awaiting_session_start, like the other methods, with authStateInfo.externalWalletUrl set. Connection-only wallets (and connectExternalWallet) skip the Para-hosted page and use these phases:Para-hosted pages: On Para’s updated authentication flow, every step that collects a code, credential, or signature runs on a Para-hosted page. Your UI opens the URL from
authStateInfo and waits; the sign-in call resolves when the user finishes. Every email or phone sign-in starts with the code, for new and returning users alike, and a returning passkey, password, or PIN user proves that credential after the code. If the user also has to set up their first passkey, password, or PIN, isCredentialSetup turns true and the matching creation URLs appear.walletPhase — Wallet Setup Detail
Email / Phone Authentication
Usepara.authenticateWithEmailOrPhone() to authenticate a user by email or phone. The method handles the complete flow: determining whether the user is new or returning, session polling, and wallet creation. Combine it with the state listener above, which opens the hosted code page and any passkey, password, or PIN page.
{ phone: '+1234567890' } instead of { email }:
OAuth Authentication
Usepara.authenticateWithOAuth() to authenticate a user via a third-party OAuth provider. The method manages the OAuth redirect/popup, polls for completion, waits for session establishment, and creates wallets for new signups.
Bringing your own Custom OIDC provider? It works like a standard OAuth provider here — pass
"CUSTOM_OIDC" as the method once it’s configured.Standard OAuth (Google, Apple, Discord, X, Facebook)
For standard OAuth providers, call the method from your button’s click handler. WithonOAuthPopup, the SDK opens the popup on the click, passes it to your callback, and then sends it to Para’s hosted sign-in page. The state listener opens the passkey, password, or PIN creation page if the account must create one after the OAuth step.
Telegram
Telegram authentication works the same way — pass"TELEGRAM" as the method:
Farcaster
Farcaster works the same way. Pass"FARCASTER" as the method. The Para-hosted page in the popup runs the Farcaster sign-in, so you don’t render a QR code yourself:
Custom OAuth and OIDC Connections
Your default Custom OIDC provider signs in like any other provider: pass"CUSTOM_OIDC" as the method to authenticateWithOAuth, as in the example above. For a custom provider connection you added with its own handle (an OAuth 2.0 provider or an additional OIDC provider), sign users in with para.authenticateWithCustomOAuth(). Pass "CUSTOM_OIDC" for an OIDC connection or "CUSTOM_OAUTH" for an OAuth 2.0 connection, plus the connection’s handle. Call it directly from the click handler with onOAuthPopup: the SDK opens the popup immediately and navigates it to the hosted page itself.
AuthenticateResponse as the other methods.
External Wallets
On this flow, signing in with an external wallet also goes through a Para-hosted page (authStateInfo.externalWalletUrl). That page asks the Para SDK’s wallet connectors in your app to sign the sign-in message, and the Para Modal provides those connectors. Calling loginExternalWallet from @getpara/web-sdk on its own doesn’t answer that request, so use the Para Modal for external wallet sign-in.
Account Linking
If the email, phone, or social account the user signs in with matches an existing Para account, the hosted page may ask whether to link them. While it does,authStateInfo.isLinking is true. The hosted page handles the choice; keep it open and, if you like, show “Linking your account” in your UI. The sign-in call resolves as usual once the user decides.
Cancelling Authentication
Both methods accept polling callbacks with anisCanceled function. Return true from isCanceled to stop the polling loop, for example when the user clicks a cancel button or navigates away. The SDK fires the optional onCancel callback, and the pending call rejects with a Session waiting canceled error.
The Para-hosted page can close its own window after a step, so a closed popup doesn’t always mean that the user gave up. For example, the user may still need to create a passkey, password, or PIN.
authStateInfo.userId is still null, and give the SDK one more check before deciding:
sessionPollingCallbacks.isCanceled: createPopupCancelCheck().
For OAuth, pass the same sessionPollingCallbacks. The OAuth step runs on the Para-hosted page, so the SDK doesn’t use oAuthPollingCallbacks on the web:
para.cancelAuthFlow(). It stops the flow and returns authPhase to unauthenticated:
para.logout() also cancels all active polling and resets the state phases back to unauthenticated, and clears the session:
Handling Results
Both methods return anAuthenticateResponse object with the same shape: