Modify the JS file in the site collection with the user input text using a Add-in

37 Views Asked by At

We've a sharepoint add-in to insert Application insights Js script file into classic site collection and include that in a master page. We need to change the key from the JS script before or after inserting. Key will be an user input. Can this instrumentation key taken from user be stored somewhere at site collection level and accessed by the javascript run time?

1

There are 1 best solutions below

0
Mark Wolff On

You can change the instrumentation key at runtime from the config object.

window.appInsights.config.instrumentationKey = "ikey";