Dash0 Web SDK
This SDK enables users of Dash0's web monitoring features to instrument a website or single-page-application to capture
and transmit telemetry to Dash0.
Features include:
- Page view instrumentation
- Navigation timing instrumentation
- HTTP request instrumentation
- Error tracking
Getting started
Prerequisites
To setup the web sdk you'll need the following:
Installation steps
- Add the SDK to your dependencies
npm install @dash0/sdk-web
yarn add @dash0/sdk-web
pnpm install @dash0/sdk-web
- Initialize the SDK in your code: you'll need to call the
init function at a convenient time in your applications lifecycle.
Ideally this should happen as early as possible in the web page initialization, as most instrumentations shipped by the SDK can only observe events after init has been called.
import { init } from "@dash0/sdk-web";
init({
serviceName: "my-website",
endpoint: {
url: "{OTLP via HTTP endpoint}",
authToken: "{authToken}",
},
});
For more detailed instructions, refer to INSTALL.md.
Development
See DEVELOPMENT.md for instructions on the development setup, testing and release process.