# How to add an external javascript CDN in sage 9

**URL:** https://discourse.roots.io/t/how-to-add-an-external-javascript-cdn-in-sage-9/11968
**Category:** sage
**Created:** 2018-03-20T18:12:15Z
**Posts:** 5

## Post 1 by @beulah — 2018-03-20T18:12:15Z

Does anyone know how would the process of adding an external CDN script in sage 9 be?? I have an external CDN script that I need to include in my project using sage 9. Here is its source "[https://service.force.com/embeddedservice/4.1/esw.min.js](https://service.force.com/embeddedservice/4.1/esw.min.js)"  
Thanks for your help!

---

## Post 2 by @alwaysblank — 2018-03-20T18:27:23Z

I’m not sure how this question is Sage-specific. You add scripts with [`wp_enqueue_script()`](https://developer.wordpress.org/reference/functions/wp_enqueue_script/) just like you would with any other theme.

If you need access to it in your local scripts, you can [add it to `externals` in your webpack config](https://discourse.roots.io/t/how-does-sage-9-enqueue-jquery/11239/8?u=alwaysblank) so that webpack won’t attempt to import it.

---

## Post 3 by @alwaysblank — 2018-03-20T19:03:21Z



---

## Post 4 by @beulah — 2018-03-20T19:17:32Z

Thanks for your response to this topic. It seems like some additional steps were taken in the mapping process of the external cdn script in reference to this topic [What's the best way to add external (CDN) scripts?](https://discourse.roots.io/t/whats-the-best-way-to-add-external-cdn-scripts/3886)  
for instance, the script is being added in lib/assets.php, and using bower. sage 9 has different file structure and uses a different package manager.

---

## Post 5 by @alwaysblank — 2018-03-20T20:16:11Z

Package managers by definition do not manage external scripts.

The file where you enqueue your scripts is largely up to you: You just need to make sure it’s being loaded at the correct time in WordPress’s process. All of that is explained in the [Codex entry for wp\_enqueue\_script()](https://developer.wordpress.org/reference/functions/wp_enqueue_script/).
