# Dont understand to switch camera from the app to the client

**URL:** <https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450>\
**Category:** Zoom Apps\
**Created:** [November 29, 2022, 3:44pm UTC](https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450 "2022-11-29T15:44:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.caruchet](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/thomas.caruchet/32/43373_2.png) [@thomas.caruchet](https://devforum.zoom.us/u/thomas.caruchet)\
**Post date:** [November 29, 2022, 3:44pm UTC](https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450/1 "2022-11-29T15:44:56Z")

</div>

**Zoom Apps configuration**

- Vanilla JS, Node.js Sample Zoom App with Node JS.

**Description**  
Hello, I do not understand with the structure how from a button on my application, order the client to change a camera by another. I do not understand the structure and I can not request the client with its SDK (impossible to import on the node.js server)…

I wonder how to do it, I have my button on the server with my index.pug page and I would like it to switch camera on the client but I do not understand how I can do it…

I need to use a Zoom App.

I thank you very much.

---

<div class="post-metadata">

**Author:** ![Robert.Wallis](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/robert.wallis/32/38438_2.png) [@Robert.Wallis](https://devforum.zoom.us/u/Robert.Wallis)\
**Post date:** [November 30, 2022, 6:29pm UTC](https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450/2 "2022-11-30T18:29:39Z")

</div>

You could use the zoomSdk.listCameras() api to get the list of cameras, and zoomSdk.setCamera() api to change the camera.

> **[Zoom Apps JS SDK reference](https://marketplace.zoom.us/docs/zoom-apps/js-sdk/reference/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![thomas.caruchet](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/thomas.caruchet/32/43373_2.png) [@thomas.caruchet](https://devforum.zoom.us/u/thomas.caruchet)\
**Post date:** [November 30, 2022, 6:57pm UTC](https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450/3 "2022-11-30T18:57:12Z")

</div>

Hi !!  
Thanks for your help.

Now, I need help to implement it. Because starting from the zoomapps sample js: I don’t understand how I can import the SDK into the “server” folder and also how I can communicate with the client and order him to change cameras with it.

I don’t know what the “public” folder in the sample corresponds to. Who already has the SDK imported in the example but I don’t know how to make the link between the two…

It seems so simple and yet I don’t understand how concretely from this zoomapps-sample-js project I can manage to use the sdk ON THE CUSTOMER to change cameras… I can only change the index.pug pages and the routes…

Thanks for all !!!  
Best regards  
Thomas

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [December 2, 2022, 12:17am UTC](https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450/5 "2022-12-02T00:17:45Z")

</div>

@thomas.caruchet The Zoom SDK cannot be imported server-side necessarily. If you wanted to add it to the pug, then you would create a script tag and enter JS there. However, that would still be in the client.

Instead, it currently serves the public/js/index.js file where the Zoom SDK is already imported and you can start building from there.

index.pug then uses that file in its own script tag.

I hope that helps!

---

<div class="post-metadata">

**Author:** ![thomas.caruchet](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/thomas.caruchet/32/43373_2.png) [@thomas.caruchet](https://devforum.zoom.us/u/thomas.caruchet)\
**Post date:** [December 3, 2022, 7:41am UTC](https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450/6 "2022-12-03T07:41:33Z")

</div>

Hi ! Thanks for your answer !

I will try like that, if I need help again, I will post here.

So, the public/js/index.js « import » the index.pug of the server.  
I will try to order the public from the server to change the camera !

Best regards 🙂

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [December 5, 2022, 11:57pm UTC](https://devforum.zoom.us/t/dont-understand-to-switch-camera-from-the-app-to-the-client/79450/7 "2022-12-05T23:57:19Z")

</div>

I’m glad that helped! Yes, index.pug uses public/js/index.js so you should only really need to change index.js in most cases.

Here is a fork of the [Basic Sample App](https://github.com/zoom/zoomapps-sample-js) that implements immersive mode:

> **[GitHub - zoom/zoomapps-customlayout-js: A simple podcaster Zoom App to...](https://github.com/zoom/zoomapps-customlayout-js)**
>
> A simple podcaster Zoom App to demonstrate Immersive Mode through our Layers API - GitHub - zoom/zoomapps-customlayout-js: A simple podcaster Zoom App to demonstrate Immersive Mode through our Laye...

It’s a bit complex and could benefit from a framework but let me know if you have any questions!
