Firebase Hooksv0.2.0

Auth

Twenty hooks covering every Firebase Auth client flow, plus the provider that holds them together.

Every Firebase Auth client flow, one hook each. They all follow the same contract, so learning one is learning the rest.

import {
  AuthProvider,
  useLogin,
  AUTH_ERROR_MESSAGES,
} from '@timonwa/firebase-hooks/auth';

Start here

Signing in and out

HookWhat it does
useLoginEmail/password sign-in
useSignupSignup with optional profile and verification email
useLogoutSign-out, your server session cleared first
useOAuthSignInAny provider — popup or redirect, both halves handled
useEmailLinkSignInPasswordless magic link, no window.prompt
usePhoneSignInSMS code with a managed reCAPTCHA verifier
useAnonymousSignInGuest sessions, upgradeable later
useCustomTokenSignInServer-minted custom token

Passwords

HookWhat it does
useSendPasswordResetEmailThe forgot-password email
useConfirmPasswordResetComplete a reset from the emailed code
useUpdatePasswordChange it, reauthentication built in

Email

HookWhat it does
useSendEmailVerificationThe resend-verification button
useVerifyEmailApply the emailed code on mount
useUpdateEmailChange it via verify-before-update

Account and linking

HookWhat it does
useUpdateProfileDisplay name and photo URL
useDeleteAccountDelete, with reauth and server cleanup
useReauthenticateThe recent-sign-in check, standalone
useLinkProviderAdd a sign-in method — upgrade a guest
useUnlinkProviderRemove a sign-in method

Not covered yet

Multi-factor auth (TOTP and SMS enrolment/resolution) and multi-tenancy are planned for a later minor. The Admin SDK is server-side and out of scope — see Compatibility.

On this page