Delete Account Button
DeleteAccountButton adds a confirmation step before requesting account
deletion. The current implementation sends a full-wipe request with a 30-day
schedule, then clears the active local login when cleanup succeeds.
Add the action
import { DeleteAccountButton } from "@ovok/native";
import { useRouter } from "expo-router";
import { Alert } from "react-native";
export function AccountActions() {
const router = useRouter();
return (
<DeleteAccountButton
title="Delete account"
onSuccess={() => router.replace("/sign-in")}
onError={() =>
Alert.alert(
"Couldn't complete the request",
"Try again or contact support.",
)
}
/>
);
}
Render the control below OvokProvider and the SDK
ThemeProvider. The SDK supplies a confirmation modal with cancel and delete
actions. onPress runs when the modal opens, before the user confirms.
What confirmation does
The SDK calls requestDeleteUser({ days: 30, wipe: true }). After the server
accepts that request, the component clears the active login, signs out of Google
when needed, notifies mounted session hooks, and calls onSuccess when cleanup
finishes.
onError can mean the deletion request failed, or that a later local cleanup
step failed after the server accepted the request. Do not treat the callback
alone as proof that deletion was rejected. The dialog closes after either
outcome.
Before exposing this action, align the confirmation copy and support path with your product and backend deletion policy. The SDK does not provide an undo operation or decide what account-deletion policy applies.
Related guides
- Logout button for ordinary sign-out
- Session management for session state after account changes