BETTER-AUTH. UI
Mutations

useDeleteApiKey

Delete an API key for the current user.

Requires the Better Auth API key plugin.

Usage

import { authClient } from "@/lib/auth-client"
import { useDeleteApiKey } from "@better-auth-ui/react/plugins/api-key"

const mutation = useDeleteApiKey(authClient)

mutation.mutate(/* params */)

Options factory

import { deleteApiKeyOptions } from "@better-auth-ui/core/plugins/api-key"
import { useMutation } from "@tanstack/react-query"

const mutation = useMutation(deleteApiKeyOptions(authClient))

Params

Prop

Type

Last updated on

On this page