@nhost/react
Version:
Nhost React library
32 lines (31 loc) • 1.24 kB
TypeScript
import { SignInSecurityKeyPasswordlessHandlerResult, SignInSecurityKeyPasswordlessState } from '@nhost/nhost-js';
interface SignInSecurityKeyPasswordlessHandler {
(email: string): Promise<SignInSecurityKeyPasswordlessHandlerResult>;
}
export interface SignInSecurityKeyPasswordlessHookResult extends SignInSecurityKeyPasswordlessState {
signInEmailSecurityKey: SignInSecurityKeyPasswordlessHandler;
}
interface SignInSecurityKeyPasswordlessHook {
(): SignInSecurityKeyPasswordlessHookResult;
}
/**
* Use the hook `useSignInEmailSecurityKey` to sign in a user using their email and a security key using the WebAuthn API.
*
* @example
* ```tsx
* const { signInEmailSecurityKey, needsEmailVerification, isLoading, isSuccess, isError, error } = useSignInEmailSecurityKey()
*
* console.log({ needsEmailVerification, isLoading, isSuccess, isError, error });
*
* const handleFormSubmit = async (e) => {
* e.preventDefault();
*
* await signInEmailSecurityKey('joe@example.com')
* }
* ```
*
* @docs https://docs.nhost.io/reference/react/use-sign-in-web-authn
*/
export declare const useSignInEmailSecurityKey: SignInSecurityKeyPasswordlessHook;
export {};
//# sourceMappingURL=useSignInEmailSecurityKey.d.ts.map