Peer dependencies: react and react-dom 18 or later. Depends on @scute/js-core and @scute/react-hooks; components and hooks need AuthContextProvider (except ScuteSignIn with preview).
Components#
| Export | Props |
|---|---|
| ScuteSignIn | ScuteSignInProps: appearance?, copy?, legal?, methods?, defaultEmail?, showLastUsed?, preview?, onSignedIn? |
| ScuteAuthGate | ScuteAuthGateProps: children, onAuthenticated?, renderView?, appearance?, copy?, legal?, methods?, defaultEmail?, showLastUsed? |
Hooks#
| Hook | Signature |
|---|---|
| useScuteAuthFlow | (): state and actions; see Auth gate and headless |
| useScuteSignInStep | () => { view, mood, errorCount } |
| useUserProfile | () => UseUserProfileResult |
| useSessions | () => UseSessionsResult |
| useAlternatePhones | () => UseAlternatePhonesResult |
| useSecureAccount | () => UseSecureAccountResult |
| useElementUserRoles | (source: ElementsSource) => UseElementUserRolesResult |
| useElementAccessRequests | (source, { kind?, status? }?) => UseElementAccessRequestsResult |
| useElementDecisionLog | (source, { userId?, decision? }?) => UseElementDecisionLogResult |
Functions and constants#
| Export | |
|---|---|
| getLastUsedMethod | () => LastUsedMethod | null |
| markLastUsedMethod | (method: LastUsedMethod) => void |
| RESEND_COOLDOWN_SECONDS | 30 |
| APP_SETTINGS_UNAVAILABLE | "app_settings_unavailable" |
Types#
| Type | |
|---|---|
| ScuteSignInProps, ScuteSignInAppearance, ScuteSignInCopy, ScuteSignInLegal, ScuteSignInMethods, ScuteSignInPreview, ScuteSignInMood | Sign-in props; see Sign-in component |
| ScuteSignInStep | { view, mood, errorCount } |
| ScuteAuthGateProps | Gate props |
| ScuteAuthFlow | The useScuteAuthFlow() result |
| AuthFlowView | The flow's views; see Views |
| SignInRefusalCode | "user_banned" | "user_suspended" | "ip_blocked" | "country_blocked" | "security_block" |
| LastUsedMethod | "email" | "phone" | "passkey" | "sso" or a provider name |
| UseUserProfileResult, UpdateMetaResult | Profile hook |
| UseSessionsResult, SessionsResult, SessionsErrorCode, RevokeSessionResult | Sessions hook |
| AlternatePhone, AlternatePhoneErrorCode, AlternatePhonesResult, AddResult, VerifyResult, RemoveResult, UseAlternatePhonesResult | Phones hook |
| SecureMethodKey, SecureMethod, EnrollPhase, SecureAccountError, UseSecureAccountResult | MFA setup hook |
| ElementsSource, ElementActionResult, UseElementUserRolesResult, UseElementAccessRequestsResult, UseElementDecisionLogResult | Admin screen hooks |
Guides: Sign-in component, Auth gate and headless, Account hooks, Admin screens.