Skip to main content
Before this: create and initialize a Dynamic client (see Creating a Dynamic Client, Initializing the Dynamic Client). Here, user means the person using your app; Dynamic user is the object created after they authenticate. A user can be signed in (e.g. wallet connected) without yet having a Dynamic user. See Signing in with a Wallet for more.

Check if signed in

What counts as “signed in” is your app’s business logic, not ours. Wrap the check in a helper you own so the rule lives in one place. The minimal version is “an authenticated user exists, or any wallet is connected”:
Most apps treat “signed in” as more than the minimal check. Add the conditions your app requires to the same helper:
  • Authenticated userdynamicClient.user is set once the user authenticates.
  • Wallet connectedisAnyWalletAccountConnected() (or getWalletAccounts()) covers verified and unverified wallets.
  • Dynamic requirements satisfiedcheckUserScopes({ user, scopes: ['user:basic'] }) confirms the user has passed all Dynamic-controlled gates (KYC fields, MFA, recovery codes, device registration). See Check User Scopes.
  • Device registeredisDeviceRegistrationRequired(user). See Check if the user needs to complete device registration.
  • MFA satisfiedisUserMissingMfaAuth() and isPendingRecoveryCodesAcknowledgment() flag MFA the user still owes.
  • Required embedded walletgetChainsMissingWaasWalletAccounts() from @dynamic-labs-sdk/client/waas returns the chains where the user still needs an embedded wallet.
You’re also encouraged to fold in your own app-specific logic — a completed server-side session, accepted terms of service, a required plan or role — so “signed in” means exactly what your app needs, all in one helper:

Log the user out

Call the logout function, and it will clear all the session data, including the Dynamic user and any connected wallets (non verified wallets).

Get the current authenticated user

Get the user JWT

Update the current authenticated user

Call updateUser to update the current Dynamic user. You can pass many user fields to the function, and it will update the user with the new values. If any of the fields require OTP verification (like email or phone number), the function will return an OTPVerification object, that you can use to check what kind of OTP verification is required (email or phone number), send the OTP to the user, and verify the OTP.

Check if a user has missing fields

You can toggle user data collected and also to be required or not in the Dynamic dashboard. We don’t control that in the JavaScript SDK, but you can check if a user has missing fields by calling the user.missingFields property. With that, you can display the appropriate UI to the user to complete the onboarding process, and call the updateUser function to update the user with the missing fields.

Check if Dynamic requirements are satisfied

Use checkUserScopes to verify the user has the user:basic scope — meaning all Dynamic-controlled requirements (KYC fields, MFA, recovery codes, device registration) are met:
See checkUserScopes for the full reference and guidance on composing your own readiness checks.

Check if the user needs to complete device registration

After authentication, you can check whether the current device needs to be registered and complete registration on redirect. For the full flow, see Device Registration.

Refreshing the current authenticated user (Dynamic user)

You can refresh the current authenticated user (Dynamic user) by calling the refreshUser function. This function will refresh the user object in the SDK with the latest data from the server.
Last modified on July 8, 2026