Overview
Better Auth React Query logo

Better Auth React Query

React Query bindings for Better Auth.

Documentation

Wrap your Better Auth client once. Methods that get or list become queries; everything else becomes a mutation, with typed query keys for cache invalidation.

const auth = createAuthQueryClient(authClient)

function Profile() {
  const { data: session } = useQuery(
    auth.getSession.queryOptions(),
  )

  return <div>Welcome, {session?.user.name}</div>
}

Version

0.0.5

Category

Auth

Downloads

35 weekly

Last updated

8 months ago

View sourceView on NPM