BETTER-AUTH. UI
Queries

useListAccounts

List linked accounts for the current user.

User-scoped query helpers wait for the active session user before firing. They use skipToken until userId exists, so account data stays isolated per signed-in user.

Usage

import { useListAccounts } from "@better-auth-ui/solid"

const accounts = useListAccounts(authClient)

Options factory and loader helpers

import {
  ensureListAccounts,
  fetchListAccounts,
  listAccountsOptions,
  prefetchListAccounts
} from "@better-auth-ui/solid"

const options = listAccountsOptions(authClient, userId)
await ensureListAccounts(queryClient, authClient, userId)
await prefetchListAccounts(queryClient, authClient, userId)
const accounts = await fetchListAccounts(queryClient, authClient, userId)

Invalidation

import { listAccountsOptions } from "@better-auth-ui/solid"

queryClient.invalidateQueries({
  queryKey: listAccountsOptions(authClient, userId).queryKey
})

Params

Prop

Type

Last updated on

On this page