UNPKG

@leancodepl/kratos

Version:

Headless React components library for building Ory Kratos authentication flows

42 lines 2 kB
import { ComponentType } from 'react'; import { EmailVerificationFormProps } from './emailVerificationForm'; import { OnVerificationFlowError } from './types'; export type VerificationFlowProps = { emailVerificationForm: ComponentType<EmailVerificationFormProps>; initialFlowId?: string; initialVerifiableAddress?: string; returnTo?: string; onError?: OnVerificationFlowError; onVerificationSuccess?: () => void; onFlowRestart?: () => void; }; /** * Renders email verification flow with provider context and flow management. * * @param emailVerificationForm - Component to render the verification form UI * @param initialFlowId - Optional flow ID to initialize with existing flow * @param initialVerifiableAddress - Optional email address to pre-populate * @param returnTo - Optional URL to redirect to after successful verification * @param onError - Optional callback for handling verification errors * @param onVerificationSuccess - Optional callback for successful verification * @param onFlowRestart - Optional callback when flow needs to restart * @returns JSX element with verification flow provider and wrapper * @example * ```tsx * import { VerificationFlow } from "@leancodepl/kratos"; * * function MyVerificationPage() { * return ( * <VerificationFlow * emailVerificationForm={EmailForm} * initialVerifiableAddress="user@example.com" * onVerificationSuccess={() => navigate("/dashboard")} * onError={(error) => console.error("Verification failed:", error)} * /> * ); * } * ``` */ export declare function VerificationFlow(props: VerificationFlowProps): import("react/jsx-runtime").JSX.Element; export declare function VerificationFlowWrapper({ emailVerificationForm: EmailVerificationForm, initialFlowId, initialVerifiableAddress, returnTo, onError, onVerificationSuccess, onFlowRestart, }: VerificationFlowProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=verificationFlow.d.ts.map