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

# Revoke Session

> Revoke a session using the Stytch Vanilla JS SDK

Wraps the [Revoke Session](/docs/api-reference/b2b/api/sessions/revoke-session) endpoint. Use this method to log the current member out.

When this method is called, we clear the member and session objects from the cache unless the SDK cannot contact the Stytch servers. This behavior can be overridden by using the optional param object.

### Parameters

<ParamField path="options" type="object">
  An object containing optional parameters for revoking the session.

  <Expandable title="properties">
    <ParamField path="forceClear" type="boolean">
      If set to `true`, the SDK will clear the member and session objects from the cache even if the network request to revoke the session fails. Defaults to `false`.
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="status_code" type="number">
  The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values
  equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
</ResponseField>

<ResponseField name="request_id" type="string">
  Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we
  may ask for this value to help identify a specific API call when helping you debug an issue.
</ResponseField>

<Panel>
  <RequestExample>
    ```javascript theme={null}
    import { StytchB2BClient } from '@stytch/vanilla-js/b2b';

    const stytch = new StytchB2BClient('public-token-test-b8c84de4-7d58-4ffc-9341-432b56596862');

    const logout = async () => {
      await stytch.session.revoke();
      console.log('Session revoked');
    };

    // Attach to a button
    document.getElementById('logout-button').addEventListener('click', logout);
    ```
  </RequestExample>
</Panel>
