Air-gapped Installation
Four methods for installing the Sophonz Browser SDK in air-gapped (no internet access) environments.
This guide covers installing the Sophonz Browser SDK in air-gapped environments where internet access is not available. All methods apply to both Web apps and WebView — choose the one that fits your setup.
NOTE — Applicable environments
All methods below apply to both Web apps and WebView. Choose whichever option suits your environment.
TIP — App key
Sophonz console → a project → Add App — register an app and take its key from App Management. After completing installation, all instrumentation runs automatically. For custom data collection, refer to the Sophonz Browser SDK API documentation.
Installation methods
Pick whichever of the four suits your environment.
-
Since you cannot run scripts directly from a CDN in an air-gapped environment, download the pre-bundled JavaScript file from an internet-connected machine.
Download URL:
https://cdn.sophonz.com/release/npm/@browser-sdk/latest/index.js -
Rename the downloaded
index.jsfile tosophonz-agent.jsand include it in your project. The example below assumes it is placed in thepublicfolder. -
Add it inside the
<head>tag as shown below.
<script src="./public/sophonz-agent.js">
</script>
<script>
window.Sophonz.init({
collectorUrl: '{{SOPHONZ_TRACES_COLLECTOR_URL}}',
appName: '{{YOUR_APP_NAME}}',
appVersion: '{{YOUR_APP_VERSION}}',
appKey: '{{YOUR_APP_KEY}}',
project: '{{YOUR_PROJECT}}',
deploymentEnvironment: '{{DEPLOYMENT_ENVIRONMENT}}',
});
</script>CAUTION — Package name configuration
appName must match the package name entered when registering the app. Package names may only contain a-z, A-Z, 0-9, -, _, and ..
-
collectorUrl,appName,appVersion, andappKeyare required.collectorUrlmust be set according to whether access is via internal or external network. For IP addresses use the formathttp://xxx.xxx.xxx.xxx:4318.appName— app name (package name used when registering the app)appVersion— app versionappKey— app keyproject— projectdeploymentEnvironment— deployment environment
-
Setup is complete. All instrumentation runs automatically from this point. For custom data collection, refer to the Sophonz Browser SDK API documentation.