JSPM

@datadog/browser-rum

1.2.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5644667
  • Score
    100M100P100Q227569F
  • License Apache-2.0

Package Exports

  • @datadog/browser-rum

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@datadog/browser-rum) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rum

It contains everything related to RUM stuff. When loaded, it exposes a window.DD_RUM that contains all the public APIs.

Typical use

<script src = 'https://www.datadoghq-browser-agent.com/datadog-rum-us.js'>
<script>
    window.DD_RUM.init({
        applicationId: 'XXX',
        clientToken: 'XXX',
        datacenter: 'us',
        resourceSampleRate: 100,
        sampleRate: 100
    });
</script>

API exposed in window.DD_RUM

  • Init must be called to start the tracking. Configurable options:

    • sampleRate: percentage of sessions to track. Only tracked sessions send rum events.
    • resourceSampleRate: percentage of tracked sessions with resources collection.
    • datacenter: defined to which datacenter we'll send collected data ('us' | 'eu')
    init(configuration: {
        applicationId: string,
        clientToken: string,
        datacenter?: string,
        resourceSampleRate?: number
        sampleRate?: number
    })
  • Modify the global context

    addRumGlobalContext (key: string, value: any)  # add one key-value to the default context
    setRumGlobalContext (context: Context)  # entirely replace the default context
  • Add user action

    addUserAction (name: string, context: Context)
  • Get internal context

    getInternalContext () # retrieve RUM internal context (link with other products)