Use the hook useSignOut to sign out the user.

import { useSignOut, useAuthenticated } from '@nhost/react'

const Component = () => {
  const { signOut } = useSignOut()
  const isAuthenticated = useAuthenticated()

  if (isAuthenticated) {
    return <button onClick={() => signOut()}>Sign Out</button>
  }

  return <div>Not authenticated</div>
}

Parameters


stateAll required boolean