Checks whether a user has all the specified scopes.Dynamic assigns scopes to users as they satisfy requirements — for example, user:basic is granted once a user completes MFA, device registration, and required fields. checkUserScopes lets you verify that a user holds any set of scopes you need.
import { checkUserScopes } from '@dynamic-labs-sdk/client';const user = dynamicClient.user;const hasBasicScope = checkUserScopes({ user, scopes: ['user:basic'] });
“Is the user ready?” is your app’s business logic — not ours. Dynamic only controls the user:basic gate. Everything else — wallets connected, NFTs held, plans activated, terms accepted — is yours to compose.Use checkUserScopes as a building block alongside your own conditions:
isUserOnboardingComplete is deprecated. Use checkUserScopes({ user, scopes: ['user:basic'] }) instead.
isUserOnboardingComplete checked the same Dynamic-controlled requirements that user:basic represents, but its name implied it could tell you whether a user had “completed onboarding”, which is inherently app-specific. The replacement makes the contract explicit: you check scopes, and you decide what “ready” means for your app.Migration:Before:
import { isUserOnboardingComplete } from '@dynamic-labs-sdk/client';const ready = isUserOnboardingComplete();
After:
import { checkUserScopes } from '@dynamic-labs-sdk/client';const user = dynamicClient.user;const ready = checkUserScopes({ user, scopes: ['user:basic'] });