sdk.auth.email
Email OTP authentication methods.
sendOTP
Send a one-time password (OTP) to a user’s email address for authentication.
Parameters
- email (String) - User’s email address
Example
verifyOTP
Verify an email OTP code and authenticate the user.
Parameters
- token (String) - OTP code entered by user
Example
resendOTP
Resend the email OTP.
Example
sdk.auth.sms
SMS OTP authentication methods.
sendOTP
Send a one-time password (OTP) to a user’s phone number via SMS.
Parameters
- phoneData (PhoneData) - Phone data containing dial code, ISO code, and phone number
Example
verifyOTP
Verify an SMS OTP code and authenticate the user.
Parameters
- token (String) - OTP code entered by user
Example
resendOTP
Resend the SMS OTP.
Example
sdk.auth.social
Social authentication methods.
connect
Authenticate with a social provider.
Parameters
- provider (SocialProvider) - Social provider to authenticate with (
.google, .apple, .farcaster)
Example
sdk.auth.passkey
Passkey authentication methods.
signIn
Sign in with a passkey.
Example
sdk.auth.externalAuth
External JWT authentication.
signInWithExternalJwt
Authenticate using an external JWT token.
Parameters
- props (SignInWithExternalJwtParams) - Parameters containing the JWT token
Example
Authentication State
authenticatedUser
Get the current authenticated user.
Example
authenticatedUserChanges
Combine publisher for authentication state changes.
Example
token
Get the current authentication token.
tokenChanges
Combine publisher for token changes.
minAuthToken
Get the current minified authentication token. This is a compact JWT suitable for bandwidth-constrained environments.
Example
minAuthTokenChanges
Combine publisher for minified token changes.
Example
Refresh session
A signed-in user’s profile and wallets can change on the server after sign-in, for example when a business account owner shares wallets with the user. Use the refresh methods to pull those changes into the SDK without signing the user out. Both methods return the refreshed UserProfile, or nil if no user is authenticated, and update authenticatedUser and authenticatedUserChanges through the same events as any other profile change.
refreshUser
Re-fetch the current user profile from the server. The session token is not rotated.
refreshAuth
Re-verify the current session without prompting the user, rotate the auth token, and update the user profile from the response. token, tokenChanges, minAuthToken, and minAuthTokenChanges also emit the new values. Use this method instead of refreshUser when a change depends on a fresh session, such as wallets newly shared through a business account.
refreshAuth needs a webview build that supports the request. If the webview does not answer within 30 seconds, for example on an older build, the call throws DynamicSDKError.timeout, as does refreshUser.
Example
Logout
logout
Log out the current user.
Example
Complete Authentication Flow
Email Authentication Flow
SMS Authentication Flow
Social Authentication
Passkey Authentication
External JWT Authentication
Last modified on November 17, 2026