on 12 Apr 2023 01:00 AM
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 Web Application -> Settings -> Setup.
Note: This application must be the matching web application for your hybrid/mobile application
2. Save the file locally (in any directory). 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 jsSnippet.txt by default.
3. There are 2 ways to build the app:
- Via the custom configurations in the dynatrace.config.js. Your config.js will look like the screenshot below:
Then you can build the application as you normally would by running "cordova build android/ios".
- Via custom Command Line Interface (CLI) arguments:
cordova build android --jsagent=C:/path/to/jsSnippet.txt
Note: If both custom CLI arguments and custom configuration arguments are used, custom CLI arguments will be used.