# How to join a session as a host with Web Video SDK (instant)?

**URL:** <https://devforum.zoom.us/t/how-to-join-a-session-as-a-host-with-web-video-sdk-instant/50518>\
**Category:** Web\
**Created:** [May 18, 2021, 6:06pm UTC](https://devforum.zoom.us/t/how-to-join-a-session-as-a-host-with-web-video-sdk-instant/50518 "2021-05-18T18:06:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fran6](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@Fran6](https://devforum.zoom.us/u/Fran6)\
**Post date:** [May 18, 2021, 6:06pm UTC](https://devforum.zoom.us/t/how-to-join-a-session-as-a-host-with-web-video-sdk-instant/50518/1 "2021-05-18T18:06:24Z")

</div>

There is no host on any sessions joined.  
Even when changing the topic or password.  
Based on other forum topic ([49275](https://devforum.zoom.us/t/how-to-join-a-session-as-host-with-web-video-sdk/49275)) it is suppose that the first participant joining a topic will be a host.

**Error**

- On every joined session when calling `client.getCurrentUserInfo()` i can see that `isHost: false`.
- Since there is no host there is no way to set the chat privilege so i get the error `INSUFFICIENT_PRIVILEGES: only host or co-host can do the operation`.

**Which Web Video SDK version?**  
1.0.3

**To Reproduce**

```auto
this.client = ZoomVideo.createClient();

const signature = generateInstantToken(
  this.APP_ZOOM_KEY,
  this.APP_ZOOM_SECRET,
  session_name,
  password
);

(async () => {
    await this.client.init('en-US', this.APP_URL+'dist/lib');
    await this.client
      .join(session_name, signature, user_name, password)
      .then(async () => {
        console.log('join success', this.client.getCurrentUserInfo());

        //this.client.makeHost(this.currentUserInfo.userId);

        this.chat = this.client.getChatClient();
        if(this.chat) {
          
          this.chat
            .setPrivilege(this.MEETING_PRIVILEGE_ALL)
            .then((v) => {
              this.chat.sendToAll('test');
            })
            .catch((v) => {
              console.error(v);
            });
        }
      });
})();

```

**Device:**

- Device: Desktop
- OS: Windows
- Browser: Firefox, Chrome

---

<div class="post-metadata">

**Author:** ![Fran6](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@Fran6](https://devforum.zoom.us/u/Fran6)\
**Post date:** [May 19, 2021, 3:54pm UTC](https://devforum.zoom.us/t/how-to-join-a-session-as-a-host-with-web-video-sdk-instant/50518/2 "2021-05-19T15:54:04Z")

</div>

I just find out that weirdly on joining a session there is multiple event triggered and at some point there is one that the participant is the host.

```auto
this.client = ZoomVideo.createClient();

this.client.on('connection-change', async (payload) => {
  console.log('connection-change', payload);
});

this.client.on('user-added', (payload) => {
  console.log('user-added', 'isHost: '+payload[0].isHost);
});

(async () => {
    await this.client.init('en-US', this.APP_URL+'dist/lib');
    await this.client
      .join(session_name, signature, user_name, password)
      .then(async () => {
        console.log('join()', 'isHost: '+this.client.getCurrentUserInfo().isHost);
      })
      .catch((error) => {
          console.error(error);
      });
})();

```

![Capture](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/b/9bf54400dab6b2eebf82a4dc61be1c4756f9f3e6.jpeg)

So when joining the participant is not the host and then the event `user-added` is called two times (even if it’s the same participant) and on the last event it is marked as the host.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [May 19, 2021, 6:19pm UTC](https://devforum.zoom.us/t/how-to-join-a-session-as-a-host-with-web-video-sdk-instant/50518/3 "2021-05-19T18:19:59Z")

</div>

Hey @Fran6 ,

You can also checkout our docs here to manage the users roles, including a host:

> **[Manage Meetings - Essential Guides - Web - Video SDKs - Zoom Software...](https://marketplace.zoom.us/docs/sdk/video/web/essential/sessions#host-and-manager-privileges)**
>
> Manage Meetings
> 
> 
> 
> This guide describes how hosts can manage participants and roles in a meeting.
> 
> Definitions
> 
> Participants are the users currently joi...

Thanks,  
Tommy

---

<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:** [June 19, 2021, 4:20am UTC](https://devforum.zoom.us/t/how-to-join-a-session-as-a-host-with-web-video-sdk-instant/50518/4 "2021-06-19T04:20:21Z")

</div>

Closed on June 19, 2021, 4:20am UTC

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