---
title: Auth Basic Example | React Query Firebase
description: A basic example of using the useAuthUser hook.
---

# Auth: Basic Example

This example subscribes to the users authentication state, allowing both
sign-in and sign-out.

> [View example code.](https://github.com/invertase/react-query-firebase/tree/main/examples/auth-basic)

export const iframe = () => <iframe />;

<iframe
  src="https://codesandbox.io/embed/github/invertase/react-query-firebase/tree/main/examples/auth-basic?fontsize=14&hidenavigation=1&theme=dark"
  style={{
    width: "100%",
    height: "700px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  title="invertase/react-query-firebase: auth-basic"
  allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
/>
