Skip to content

Commit

Permalink
update code snippet for TS, ET standalone (#26679)
Browse files Browse the repository at this point in the history
* update code snippet for TS

* Update content/en/real_user_monitoring/browser/setup/client.md

Co-authored-by: Sandra (neko) <[email protected]>

---------

Co-authored-by: Sandra (neko) <[email protected]>
  • Loading branch information
meghanlo and neko-dd authored Dec 12, 2024
1 parent 24750a2 commit 367e027
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions content/en/real_user_monitoring/browser/setup/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,23 @@ window.DD_RUM.init({
{{% /tab %}}
{{% tab "Error Tracking" %}}

TypeScript is not supported for Error Tracking.

Types are compatible with TypeScript >= 3.8.2. To initialize the SDK, use the following code snippet.

<div class="alert alert-info"><strong>Note</strong>: For earlier versions of TypeScript, import JavaScript sources and use global variables to avoid any compilation issues.</div>

```javascript
import '@datadog/browser-rum/bundle/datadog-rum'

window.DD_RUM.init({
applicationId: 'XXX',
clientToken: 'XXX',
site: 'datadoghq.com',
trackUserInteractions: true,
trackResources: true,
...
})
```

{{% /tab %}}
{{< /tabs >}}
Expand Down Expand Up @@ -2464,4 +2480,4 @@ This option is not supported for Error Tracking.
[1]: /real_user_monitoring/
[2]: /error_tracking/
[3]: https://github.com/DataDog/browser-sdk/blob/main/packages/rum/BROWSER_SUPPORT.md
[4]: https://www.npmjs.com/package/@datadog/browser-rum
[4]: https://www.npmjs.com/package/@datadog/browser-rum

0 comments on commit 367e027

Please sign in to comment.