> For the complete documentation index, see [llms.txt](https://ksdaemon.gitbook.io/wampy.js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ksdaemon.gitbook.io/wampy.js/api/disconnect.md).

# disconnect()

### disconnect()

Disconnects from wamp server. Clears all queues, subscription, calls. Returns `promise`:

* Resolved when wampy disconnects from WAMP server and closes websocket connection
* Rejected with [error](broken://pages/e80SGqRyzZXRlbWTYu1Y) happened (probably never)

```javascript
await ws.disconnect();
```
