BETTER-AUTH. UI
Queries

useListPasskeys

List passkeys registered for the current user.

Requires the Better Auth passkey plugin. Use this query in passkey settings screens and invalidate it after add/delete passkey mutations.

Usage

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

const passkeys = useListPasskeys(authClient)

Options factory and loader helpers

import {
  ensureListPasskeys,
  fetchListPasskeys,
  listPasskeysOptions,
  prefetchListPasskeys
} from "@better-auth-ui/solid"

const options = listPasskeysOptions(authClient, userId)
await ensureListPasskeys(queryClient, authClient, userId)
await prefetchListPasskeys(queryClient, authClient, userId)
const passkeys = await fetchListPasskeys(queryClient, authClient, userId)

Invalidation

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

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

Params

Prop

Type

Last updated on

On this page