# Cleanup APIs to be called in web video SDK

**URL:** <https://devforum.zoom.us/t/cleanup-apis-to-be-called-in-web-video-sdk/80348>\
**Category:** Web\
**Created:** [December 15, 2022, 2:50pm UTC](https://devforum.zoom.us/t/cleanup-apis-to-be-called-in-web-video-sdk/80348 "2022-12-15T14:50:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kvr](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kvr](https://devforum.zoom.us/u/kvr)\
**Post date:** [December 15, 2022, 2:50pm UTC](https://devforum.zoom.us/t/cleanup-apis-to-be-called-in-web-video-sdk/80348/1 "2022-12-15T14:50:51Z")

</div>

Hi,

I am using web video SDK UMD files in the Vuejs application. I am calling the below APIs for cleanup while going to another page in the application.  
//At the startup creating the instance of auduotrack, mediaStream and client.

```
   //Cleanup
    await this.audioTrack.stop();
    await this.mediaStream.stopAudio();
    await this.mediaStream.stopVideo();
    client.leave();
    if(typeof WebVideoSDK !== 'undefined'){
        WebVideoSDK.default.destroyClient();
    }

```

Please let me know If I am calling the API in the proper sequence? Is there any other API to be called during cleanup?

**Which Web Video SDK version?**  
1.5.5

**Device (please complete the following information):**

- Device: Desktop  
Processor: AMD Ryzen 5 2600 six-core processor
- OS: Windows 10 Pro
- Browser: [e.g. Chrome]
- Browser Version : 108.0.5359.99 (Official Build) (64-bit)

Thanks  
Krishnan

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [December 15, 2022, 3:04pm UTC](https://devforum.zoom.us/t/cleanup-apis-to-be-called-in-web-video-sdk/80348/2 "2022-12-15T15:04:54Z")

</div>

Hey @kvr

Thanks for your feedback.

That’s correct with your code.

Actually, `WebVideoSDK.default.destroyClient()` is enough for the cleanup.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [January 15, 2023, 1:04am UTC](https://devforum.zoom.us/t/cleanup-apis-to-be-called-in-web-video-sdk/80348/3 "2023-01-15T01:04:59Z")

</div>

Closed on January 15, 2023, 1:04am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
