@dynamic-labs/sdk-react-core
Version:
A React SDK for implementing wallet web3 authentication and authorization to your website.
31 lines (30 loc) • 1.14 kB
TypeScript
import { AuthEventPayload } from '@dynamic-labs/types';
export type AuthEvents = {
/**
* Informs an auth attempt failed.
* In general triggered when an error occurs or when user cancels out.
* For email/sms, specifically happens when users cancels the OTP verification.
*/
authFailure: (method: AuthEventPayload,
/** Will be 'user-cancelled' when cancelled, or the error when there is an error */
reason: 'user-cancelled' | {
error: unknown;
}) => void;
/** Informs an auth attempt initialized, and provides insight into which auth option it is */
authInit: (method: AuthEventPayload) => void;
logout: () => void;
/** This event is used to trigger logout to be called, DO NOT listen to it. Listen to "logout" instead */
triggerLogout: () => void;
/**
* Emitted when the user succesfully completes an MFA challenge
*/
mfaCompletionSuccess: (args: {
mfaToken?: string;
}) => void;
/**
* Emitted when there is an error verifiyng the MFA challenge
*/
mfaCompletionFailure: (args: {
error: unknown;
}) => void;
};