# Download the javascript agent locally and build the cordova application

**URL:** <https://community.dynatrace.com/t/download-the-javascript-agent-locally-and-build-the-cordova-application/37935>\
**Category:** Troubleshooting\
**Tags:** cordova, mobile-monitoring\
**Created:** [April 12, 2023, 12:00am UTC](https://community.dynatrace.com/t/download-the-javascript-agent-locally-and-build-the-cordova-application/37935 "2023-04-12T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yngwie\_lucero](https://avatars.discourse-cdn.com/v4/letter/y/3d9bf3/32.png) [@yngwie\_lucero](https://community.dynatrace.com/u/yngwie_lucero)\
**Post date:** [April 12, 2023, 12:00am UTC](https://community.dynatrace.com/t/download-the-javascript-agent-locally-and-build-the-cordova-application/37935/1 "2023-04-12T00:00:00Z")

</div>

**Why download the js agent locally?**  
In some cases, there might be connectivity issues/limitations that prevent the successful download of the javascript agent (ruxitagentjs). In this case, you can save the script locally and build the application accordingly.

**Here are the steps to do so:**  
1. You can download the script/file from the web application via the WebUI or API. If via UI you can find it under the **W**** eb Application → Settings → Setup.**

 ![Screenshot 2023-01-10 at 2.22.55 pm.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/1/11d1585bd294f52b8b4bb55747d098151a0dbcf3.png)

Note: This application must be the matching web application for your hybrid/mobile application

2. Save the file locally (in any directory).&nbsp;Note that you can name the file whatever you want but the file and directory that you use needs to exist. The file downloaded from the WebUI will be named&nbsp;jsSnippet.txt&nbsp;by default.

3. There are 2 ways to build the app:&nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp;- Via the custom configurations in the dynatrace.config.js. Your config.js will look like the screenshot below:

 ![Screenshot 2023-01-10 at 2.52.29 pm.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/dd280cb804339632d09bbb7f1574901f964a25fe.png)

Then you can build the application as you normally would by running “ **cordova build android/ios** ”.

- Via custom Command Line Interface (CLI) arguments:

```auto
cordova build android <span>--jsagent=C:/path/to/jsSnippet.txt</span>

```

**Note:** &nbsp;If both&nbsp; custom CLI arguments and custom configuration arguments are used, custom CLI arguments will be used.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [May 12, 2023, 7:28pm UTC](https://community.dynatrace.com/t/download-the-javascript-agent-locally-and-build-the-cordova-application/37935/2 "2023-05-12T19:28:41Z")

</div>

[@yngwie\_lucero](https://community.dynatrace.com/user/24673)&nbsp;Thank you for sharing this
