logout
Remove an account and re-point (or clear) the active account. Defaults to the active account id.
Stops the JWT refresh timer, clears the bearer token, deletes the account's keyring entry (and its metadata + keystore entry), then activates the next remaining REGISTERED account (re-authenticating it) — preferring a full account over a partial (unauthenticated, handle-less) one. If only partials remain, activeAccountId is cleared.
Import
ts
import { logout } from "@0xcurvy/curvy-sdk/actions";Usage
ts
await logout(); // active account
await logout({ accountId }); // explicit accountSignature
ts
function logout(parameters?: LogoutParameters): Promise<void>Returns
Promise<void>
The action resolves or returns the value shown in the signature.
Parameters
accountId
- Type:
string - Required: no
The account whose authenticated session should be ended. Defaults to the active account.
ts
await logout({
accountId,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
ts
await logout({
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
- Authentication guide
login— Log in (add an existing account) from an account signature.loginWithPasskey— Log in via a passkey PRF output.loginWithPrivateKeys— Log in from raw spending/viewing private keys.restoreSession— Rehydrate accounts from the browser keystore after a page refresh.