BETTER-AUTH. UI
Mutations

useDeleteApiKey

Delete an API key for the current user.

Requires the Better Auth API key plugin.

Usage

import { useDeleteApiKey } from "@better-auth-ui/solid/plugins/api-key"

const deleteApiKey = useDeleteApiKey(authClient)

deleteApiKey.mutate({ keyId: "api-key-id" })

Options factory

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

const deleteApiKey = useMutation(() => deleteApiKeyOptions(authClient, userId))

Params

Prop

Type

Last updated on

On this page