Quick Start
Install the SDK and start collecting telemetry in under five minutes.
This guide walks you through adding Sophonz to an existing application.
If you use a coding agent, it can do these steps for you. See Connect an agent with MCP.
Initialize
Initialize the SDK once, as early as possible in your application bootstrap. Enter your values below and the initialization code is generated. Choose Frontend / Backend, pick the platform and framework/language with the tabs, then copy the code with the copy button.
<!-- index.html <head> -->
<script src="https://cdn.sophonz.com/release/npm/@browser-sdk/latest/index.js"></script>
<script>
window.Sophonz.init({
collectorUrl: 'https://in.sophonz.ai',
project: 'sophonz',
appName: 'next-sample',
appVersion: '1.0.0',
appKey: 'sk_tYtJUa4WweXXedj6lxjSqoPW5O0DnbXz',
});
</script>Opens a detail screen in a sample app. The browser SDK captures an action, its duration, Fetch and XHR, console and application logs, and a handled exception.
Both modes deliberately record one handled exception. Navigation is recorded in the session. Web Vitals depend on what the browser observes. Replay and sockets are outside this sample.
projectProjectappNameApp nameappVersionApp versionappKeyThe app key issued in the Sophonz console — replaceapp-key-replace-mewith your real key.
Verify
With Web selected, choose Send test telemetry, then Open this trace in Sophonz. Select an HTTP span and open Events to inspect its network timings. Logs contains the sample’s console message and application log. The sample records a handled exception so you can inspect its exception event even on a successful request.
To verify your own browser app, run an action after SDK initialization and look for its name in the app’s traces.
import Sophonz from "@sophonz/browser-sdk";
Sophonz.addAction("app.started", { version: "1.0.0" });For deployment settings, see Best Practices.