Queries
useAccountInfo
Read provider-specific account info for a linked account.
Use useAccountInfo when a settings screen needs provider metadata for the current user's linked account. It is user-scoped and waits for the active session.
Usage
import { useAccountInfo } from "@better-auth-ui/solid"
const github = useAccountInfo(authClient, {
query: { accountId: "github-account-id" }
})Options factory and loader helpers
import {
accountInfoOptions,
ensureAccountInfo,
fetchAccountInfo,
prefetchAccountInfo
} from "@better-auth-ui/solid"
const options = accountInfoOptions(authClient, userId, {
query: { accountId }
})
await ensureAccountInfo(queryClient, authClient, userId, { query: { accountId } })
await prefetchAccountInfo(queryClient, authClient, userId, { query: { accountId } })
const info = await fetchAccountInfo(queryClient, authClient, userId, { query: { accountId } })Invalidation
import { accountInfoOptions } from "@better-auth-ui/solid"
queryClient.invalidateQueries({
queryKey: accountInfoOptions(authClient, userId, {
query: { accountId: "acc_123" }
}).queryKey
})Params
Prop
Type
Last updated on