# getCurrentUser() and getCurrentMeetingInfo() returning undefined

**URL:** <https://devforum.zoom.us/t/getcurrentuser-and-getcurrentmeetinginfo-returning-undefined/41885>\
**Category:** Web\
**Created:** [January 29, 2021, 2:28am UTC](https://devforum.zoom.us/t/getcurrentuser-and-getcurrentmeetinginfo-returning-undefined/41885 "2021-01-29T02:28:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnrix](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johnrix/32/21971_2.png) [@johnrix](https://devforum.zoom.us/u/johnrix)\
**Post date:** [January 29, 2021, 2:28am UTC](https://devforum.zoom.us/t/getcurrentuser-and-getcurrentmeetinginfo-returning-undefined/41885/1 "2021-01-29T02:28:25Z")

</div>

**Description**  
Calls to getCurrentUser() and getCurrentMeetingInfo() immediately after successfully joining a meeting are both returning nothing at present. What am I doing wrong?

Code sample below includes console.log() for these functions statements that are both showing ‘undefined’.

**Error**  
N/A

**Which version?**  
1.8.6 (CDN)

**To Reproduce(If applicable)**  
Code sample below:

```
        var leaveUrl = 'https://mydomain';

        ZoomMtg.setZoomJSLib('https://dmogdx0jrul3u.cloudfront.net/1.8.6/lib', '/av'); 
        ZoomMtg.preLoadWasm();
        ZoomMtg.prepareJssdk();
       
        ZoomMtg.inMeetingServiceListener('onUserJoin', function (data) {
            console.log('onUserJoin: ', data);
        });
         
        ZoomMtg.inMeetingServiceListener('onMeetingStatus', function (data) {
            // {status: 1(connecting), 2(connected), 3(disconnected), 4(reconnecting)}
            console.log('onMeetingStatus', data);
        });

        ZoomMtg.init({
            leaveUrl: leaveUrl,
            isSupportAV: true,
            success: function() {
                ZoomMtg.join({
                    signature: JBA.signature,
                    apiKey: JBA.apiKey,
                    meetingNumber: JBA.meetingId,
                    userName: "Who am I?",
                    passWord: JBA.pwd,
                    success: function() {
                        var user = ZoomMtg.getCurrentUser({});
                        console.log('user: ', user);
                        var mtg = ZoomMtg.getCurrentMeetingInfo({});
                        console.log('mtg: ', mtg);
                    },
                    error(res) { 
                        console.log(res) 
                    }
                });
            }
        });

```

**Screenshots**  
N/A

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

- Browser: Chrome 88, Edge 87

**Additional context**  
N/A

---

<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:** [January 29, 2021, 8:57pm UTC](https://devforum.zoom.us/t/getcurrentuser-and-getcurrentmeetinginfo-returning-undefined/41885/2 "2021-01-29T20:57:58Z")

</div>

Hey @johnrix,

Thank you for reaching out to the Zoom Developer Forum. The `getCurrentUser()` function is asynchronous so you’ll want to include a callback as the argument. We have an example of this in our [Sample Web App](https://github.com/zoom/sample-app-web):

> <https://github.com/zoom/sample-app-web/blob/5bdebf62bb35a495dad6e30877317964a3601f30/Local/js/meeting.js#L65-L69>

I hope that helps! Let me know if you have any questions.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![johnrix](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/johnrix/32/21971_2.png) [@johnrix](https://devforum.zoom.us/u/johnrix)\
**Post date:** [January 29, 2021, 10:26pm UTC](https://devforum.zoom.us/t/getcurrentuser-and-getcurrentmeetinginfo-returning-undefined/41885/3 "2021-01-29T22:26:37Z")

</div>

Thanks @MaxM, that helps for sure.

That needs to be made clear in the documentation, as there are no parameters described for these methods there at present.

---

<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:** [February 1, 2021, 7:22pm UTC](https://devforum.zoom.us/t/getcurrentuser-and-getcurrentmeetinginfo-returning-undefined/41885/4 "2021-02-01T19:22:24Z")

</div>

Hey @johnrix,

Thank you for the update, I’m glad to hear that helped! I agree that this should be covered in our documentation as well as the [Sample Web App](https://github.com/zoom/sample-app-web).

@shrijana.g Would it be possible to update the [Web SDK reference](https://marketplace.zoom.us/docs/sdk/sdk-reference/web-reference) examples (such as `getCurrentUser()`) to reflect that they need a `success` callback in order to function as expected?

Thanks,  
Max

---

<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:** [March 4, 2021, 5:23am UTC](https://devforum.zoom.us/t/getcurrentuser-and-getcurrentmeetinginfo-returning-undefined/41885/5 "2021-03-04T05:23:05Z")

</div>

Closed on March 4, 2021, 5:23am UTC

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