> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abs.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# revokeSessions

> Function to revoke session keys from the connected Abstract Global Wallet.

The [AbstractClient](/abstract-global-wallet/agw-client/createAbstractClient) includes a `revokeSessions` method that can be used to revoke session keys from the connected Abstract Global Wallet.

This allows you to invalidate existing session keys, preventing them from being used for future transactions.

## Usage

Revoke session(s) by providing either:

* The session configuration object(s) (see [parameters](#parameters)).
* The session hash(es) returned by [getSessionHash()](https://github.com/Abstract-Foundation/abstract-packages/blob/ca46a71e1f6bda5d86c6ee98c209057d68852510/packages/agw-client/src/sessions.ts#L213).

```tsx theme={null}
import { useAbstractClient } from "@abstract-foundation/agw-react";

export default function RevokeSessions() {
  const { data: agwClient } = useAbstractClient();

  async function revokeSessions() {
    if (!agwClient) return;

    // Revoke a single session by passing the session configuration
    const { transactionHash } = await agwClient.revokeSessions({
      session: existingSession, 
    });

    // Or - revoke multiple sessions at once
    const { transactionHash } = await agwClient.revokeSessions({
      session: [existingSession1, existingSession2], 
    });

    // Or - revoke sessions using their creation transaction hashes
    const { transactionHash } = await agwClient.revokeSessions({
      session: "0x1234...", 
    });

    // Or - revoke multiple sessions using their creation transaction hashes
    const { transactionHash } = await agwClient.revokeSessions({
      session: ["0x1234...", "0x5678..."], 
    });

    // Or - revoke multiple sessions using both session configuration and creation transaction hashes in the same call
    const { transactionHash } = await agwClient.revokeSessions({
      session: [existingSession, "0x1234..."], 
    });
  }
}
```

## Parameters

<ResponseField name="session" type="SessionConfig | Hash | (SessionConfig | Hash)[]" required>
  The session(s) to revoke. Can be provided in three formats:

  * A single `SessionConfig` object

  * A single session key creation transaction hash from [createSession](/abstract-global-wallet/agw-client/session-keys/createSession).

  * An array of `SessionConfig` objects and/or session key creation transaction hashes.

  See [createSession](/abstract-global-wallet/agw-client/session-keys/createSession) for more information on the `SessionConfig` object.
</ResponseField>

## Returns

<ResponseField name="transactionHash" type="Hash">
  The transaction hash of the revocation transaction.
</ResponseField>
