> For the complete documentation index, see [llms.txt](https://docs.joeywallet.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.joeywallet.xyz/integration/actions/disconnect.md).

# Disconnect

The provider comes with a `disconnect` action that disconnects from the active session (if connected).&#x20;

```typescript
// Some where within your codebase...

const { actions, session, accounts } = useProvider();

const response = await actions.disconnect()
```

#### Example usage:

```jsx
// File: ./src/app/component.tsx
'use client';

import * as React from 'react';
import { useProvider } from './page';

export default function Component() {
  const { actions, session, accounts } = useProvider();

  const handleDisconnect = async () => {
    await actions.disconnect();
    // You have been connected using wallet connect.
    // Now you can start interacting with the XRP Ledger.
    // ...
  };

  return (
    <div>
      {session && (
        <button type="button" onClick={handleDisconnect}>
          Disconnect
        </button>
      )}
    </div>
  );
}
```
