UNPKG

@daveyplate/better-auth-tanstack

Version:

Tanstack hooks for better-auth

18 lines (15 loc) 522 B
import type { AnyUseQueryOptions } from "@tanstack/react-query" import type { AuthClient } from "../../types/auth-client" import { useAuthQuery } from "../shared/use-auth-query" export function useActiveOrganization<TAuthClient extends AuthClient>( authClient: TAuthClient, options?: Partial<AnyUseQueryOptions> ) { const queryKey = ["active-organization"] return useAuthQuery({ authClient, queryKey, queryFn: authClient.organization.getFullOrganization, options }) }