---
title: Browser
aliases: [/docs/js/getting_started/browser]
description: Learn how to add OpenTelemetry to your browser app
weight: 20
---
{{% alert title="Warning" color="warning" %}}
{{% _param notes.browser-instrumentation %}} {{% /alert %}}
While this guide uses the example application presented below, the steps to
instrument your own application should be similar.
## Prerequisites
Ensure that you have the following installed locally:
- [Node.js](https://nodejs.org/en/download/)
- [TypeScript](https://www.typescriptlang.org/download), if you will be using
TypeScript.
## Example Application
This is a very simple guide, if you'd like to see more complex examples go to
[examples/opentelemetry-web](https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/opentelemetry-web).
Copy the following file into an empty directory and call it `index.html`.
```html
Document Load Instrumentation Example
Example of using Web Tracer with document load instrumentation with console
exporter and collector exporter
```
### Installation
To create traces in the browser, you will need `@opentelemetry/sdk-trace-web`,
and the instrumentation `@opentelemetry/instrumentation-document-load`:
```shell
npm init -y
npm install @opentelemetry/api \
@opentelemetry/sdk-trace-web \
@opentelemetry/instrumentation-document-load \
@opentelemetry/context-zone
```
### Initialization and Configuration
If you are coding in TypeScript, then run the following command:
```shell
tsc --init
```
Then acquire [parcel](https://parceljs.org/), which will (among other things)
let you work in TypeScript.
```shell
npm install --save-dev parcel
```
Create an empty code file named `document-load` with a `.ts` or `.js` extension,
as appropriate, based on the language you've chosen to write your app in. Add
the following code to your HTML right before the `