# Global or CDN libraries?

**URL:** <https://devforum.zoom.us/t/global-or-cdn-libraries/28998>\
**Category:** Web\
**Created:** [September 3, 2020, 7:20am UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998 "2020-09-03T07:20:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvivot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nvivot/32/4489_2.png) [@nvivot](https://devforum.zoom.us/u/nvivot)\
**Post date:** [September 3, 2020, 7:20am UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/1 "2020-09-03T07:20:18Z")

</div>

Hi,

We have users on our application who permanenlty get this kind of javascript error:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/2/2d43770a45b6d3c3de318949033c34f2c8a68289.png)

Just because ZoomMtg is undefined on the window object:

```
const libPath = `https://dmogdx0jrul3u.cloudfront.net/${meta.sdkVersion}/lib`;
window. **ZoomMtg**.setZoomJSLib(libPath, '/av');

```

Looks like the related zoom libraries cannot be downloaded and provoke this error. The libraries are downloaded with a link on [zoom.us](http://zoom.us), while as show on the above code, they are initialized with a link using the CDN.

So i was looking at the code to verify how these libraries are loaded and found it’s exactly the same way as described in your official documentation [here](https://marketplace.zoom.us/docs/sdk/native-sdks/web/getting-started/integrate)

It seems that the documentation recommend to use a mix of Global & CDN URLs.  
My questions are the following one:

- I understand local & CDN concepts here, but what Global refers to exactly ? And what are the differences between Global & CDN ?
- Would not it be simpler to just use the CDN link ([cloudfront.net/](http://cloudfront.net/)) everywhere instead of the zoom “Global” one ?

Thank you in advance for your (zoom and / or community) insights 🙂

---

<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:** [September 8, 2020, 10:49pm UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/2 "2020-09-08T22:49:06Z")

</div>

Hey @nvivot,

The `import { ZoomMtg } from '@zoomus/websdk'` is for the Local version.

Are you using the [CDN version](https://marketplace.zoom.us/docs/sdk/native-sdks/web/getting-started/integrate#cdn) or the [Local version](https://www.npmjs.com/package/@zoomus/websdk)? It sounds like you could be using both which could create some issues.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![nvivot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nvivot/32/4489_2.png) [@nvivot](https://devforum.zoom.us/u/nvivot)\
**Post date:** [September 9, 2020, 12:27am UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/3 "2020-09-09T00:27:23Z")

</div>

Hi Tommy,

Sorry, my bad. I have checked the code on the wrong branch.

We are using the CDN version, with no node import and this kind of script (i have updated the original post to avoid confusion:

```
const libPath = `https://dmogdx0jrul3u.cloudfront.net/${meta.sdkVersion}/lib`;
window.ZoomMtg.setZoomJSLib(libPath, '/av');
```

---

<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:** [September 11, 2020, 6:21pm UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/4 "2020-09-11T18:21:10Z")

</div>

Hey @nvivot,

Could you please provide a sample Web SDK GitHub repo with this issue so we can reproduce and debug the issue locally?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![nvivot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nvivot/32/4489_2.png) [@nvivot](https://devforum.zoom.us/u/nvivot)\
**Post date:** [September 14, 2020, 1:17am UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/5 "2020-09-14T01:17:47Z")

</div>

Hi Tommy,

I don’t need you to reproduce the error but to answer my question(s) regarding the fact that we mix global and CDN urls to download and initialize Zoom libraries / components. And by “we” i’m not just talking about my team with our application, but also about your company in the sample application and provided tutorials.

Wouldn’t it make sense to only use CDN links everywhere ?

---

<div class="post-metadata">

**Author:** ![nvivot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nvivot/32/4489_2.png) [@nvivot](https://devforum.zoom.us/u/nvivot)\
**Post date:** [September 14, 2020, 8:14am UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/6 "2020-09-14T08:14:19Z")

</div>

I cannot provide a sample repository.

Below you have some sample code for testing, nothing new that is not on your demo application already.

```
<!DOCTYPE html>
<html lang="en">
  <head>

    <link rel="stylesheet" href="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/css/bootstrap.css" />
    <link rel="stylesheet" href="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/css/react-select.css" />
    <link rel="stylesheet" href="/css/meeting.css" />
  </head>
  <body>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/react.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/react-dom.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/redux.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/redux-thunk.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/jquery.min.js"></script>
    <script src="https://source.zoom.us/<%= process.env.ZOOM_SDK_VERSION %>/lib/vendor/lodash.min.js"></script>
    <script src="https://source.zoom.us/zoom-meeting-<%= process.env.ZOOM_SDK_VERSION %>.min.js"></script>
    <script src="/js/meeting.js"></script>
  </body>
</html>

```

/js/meeting.js refers to our main entry point script, the first instruction lines are the following ones (the one provoking the error)

```
const libPath = `https://dmogdx0jrul3u.cloudfront.net/${meta.sdkVersion}/lib`;
window.ZoomMtg.setZoomJSLib(libPath, '/av');

```

ZoomMtg does not seems to be initialized and provoke the error.

We never got such issue when we were using the NPM version so the only reason (from my understanding) for this to fail is because the libraries were not available on zoom web site. If you know other potential reasons i’m listening.

---

<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:** [September 16, 2020, 5:34pm UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/7 "2020-09-16T17:34:19Z")

</div>

Hey @nvivot,

Apologies for the confusion! 🙂

I will get back to you on your original questions:

> [@nvivot](#):
>
> - I understand local & CDN concepts here, but what Global refers to exactly ? And what are the differences between Global & CDN ?
> - Would not it be simpler to just use the CDN link ([cloudfront.net/](http://cloudfront.net/)) everywhere instead of the zoom “Global” one ?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![nvivot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nvivot/32/4489_2.png) [@nvivot](https://devforum.zoom.us/u/nvivot)\
**Post date:** [September 16, 2020, 11:18pm UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/9 "2020-09-16T23:18:09Z")

</div>

Thanks @tommy

No need.

It looks like [source.zoom.us](http://source.zoom.us) is just a CNAME for your AWS CloudFront host name.

So in the end both host name are the same services, which answer to my question : we can put any of both host name for any zoom resources.

Global and CDN terms from your documentation are the same thing then.

---

<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:** [September 17, 2020, 4:22pm UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/10 "2020-09-17T16:22:08Z")

</div>

Hey @nvivot,

Yes, I was just about to reply, [source.zoom.us](http://source.zoom.us) and the CDN version url are both the same. We will update the docs to only show [source.zoom.us](http://source.zoom.us).

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:** [October 18, 2020, 2:22am UTC](https://devforum.zoom.us/t/global-or-cdn-libraries/28998/12 "2020-10-18T02:22:19Z")

</div>

Closed on October 18, 2020, 2:22am UTC

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