@nhost/react
Version:
Nhost React library
36 lines (35 loc) • 1.34 kB
TypeScript
import { SendVerificationEmailHandlerResult, SendVerificationEmailOptions, SendVerificationEmailState } from '@nhost/nhost-js';
interface SendVerificationEmailHandler {
(email: string, options?: SendVerificationEmailOptions): Promise<SendVerificationEmailHandlerResult>;
}
export interface SendVerificationEmailHookResult extends SendVerificationEmailState {
/** Resend the verification email. Returns a promise with the current context */
sendEmail: SendVerificationEmailHandler;
}
interface SendVerificationEmailHook {
(options?: SendVerificationEmailOptions): SendVerificationEmailHookResult;
}
/**
* Use the hook `useSendVerificationEmail` to send a verification email. The verification email is sent to the user's email address and includes a link to verify the email address.
*
* @example
* ```tsx
* const { sendEmail, isLoading, isSent, isError, error } =
useSendVerificationEmail();
*
* console.log({ isLoading, isSent, isError, error });
*
* const handleFormSubmit = async (e) => {
* e.preventDefault();
*
* await sendEmail({
* email: 'joe@example.com',
* })
* }
* ```
*
* @docs https://docs.nhost.io/reference/react/use-send-verification-email
*/
export declare const useSendVerificationEmail: SendVerificationEmailHook;
export {};
//# sourceMappingURL=useSendVerificationEmail.d.ts.map