diff --git a/.github/workflows/api-docs-release.yml b/.github/workflows/api-docs-release.yml new file mode 100644 index 0000000000..6162662bbc --- /dev/null +++ b/.github/workflows/api-docs-release.yml @@ -0,0 +1,71 @@ +name: Publish API Documentation on Release + +permissions: + contents: read + pages: write + id-token: write + +on: + push: + branches: + - romanG/api-reference + tags: + - 'v*.*.*' + workflow_dispatch: + +concurrency: + group: 'api-docs-release' + cancel-in-progress: false + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'yarn' + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + + - name: Install Node dependencies + run: yarn install --frozen-lockfile + + - name: Build TS declarations + run: yarn build + + - name: Build types and generate API docs + run: | + echo "Building API documentation for version ${{ steps.version.outputs.version }}" + yarn docs:api + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Build with Jekyll + run: | + bundle exec jekyll build --source docs --destination _site --config _config_docs.yml + env: + JEKYLL_ENV: production + PAGES_REPO_NWO: ${{ github.repository }} + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..57d615bc20 --- /dev/null +++ b/Gemfile @@ -0,0 +1,12 @@ +source "https://rubygems.org" + +gem "github-pages", group: :jekyll_plugins + +group :jekyll_plugins do + gem "jekyll-sitemap" + gem "jekyll-seo-tag" + gem "jekyll-relative-links" + gem "jekyll-remote-theme" +end + +gem "webrick", "~> 1.7" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000..40f8fa50c3 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,309 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.2.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) + benchmark (0.4.1) + bigdecimal (3.2.2) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + colorator (1.1.0) + commonmarker (0.23.11) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) + dnsruby (1.72.4) + base64 (~> 0.2.0) + logger (~> 1.6.5) + simpleidn (~> 0.2.1) + drb (2.2.3) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + ethon (0.16.0) + ffi (>= 1.15.0) + eventmachine (1.2.7) + execjs (2.10.0) + faraday (2.13.1) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.1) + net-http (>= 0.5.0) + ffi (1.17.2-aarch64-linux-gnu) + ffi (1.17.2-aarch64-linux-musl) + ffi (1.17.2-arm-linux-gnu) + ffi (1.17.2-arm-linux-musl) + ffi (1.17.2-arm64-darwin) + ffi (1.17.2-x86_64-darwin) + ffi (1.17.2-x86_64-linux-gnu) + ffi (1.17.2-x86_64-linux-musl) + forwardable-extended (2.6.0) + gemoji (4.1.0) + github-pages (230) + github-pages-health-check (= 1.18.2) + jekyll (= 3.9.5) + jekyll-avatar (= 0.8.0) + jekyll-coffeescript (= 1.2.2) + jekyll-commonmark-ghpages (= 0.4.0) + jekyll-default-layout (= 0.1.5) + jekyll-feed (= 0.17.0) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.16.1) + jekyll-include-cache (= 0.2.1) + jekyll-mentions (= 1.6.0) + jekyll-optional-front-matter (= 0.3.2) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.16.0) + jekyll-relative-links (= 0.7.0) + jekyll-remote-theme (= 0.4.3) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.8.0) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.2.0) + jekyll-theme-cayman (= 0.2.0) + jekyll-theme-dinky (= 0.2.0) + jekyll-theme-hacker (= 0.2.0) + jekyll-theme-leap-day (= 0.2.0) + jekyll-theme-merlot (= 0.2.0) + jekyll-theme-midnight (= 0.2.0) + jekyll-theme-minimal (= 0.2.0) + jekyll-theme-modernist (= 0.2.0) + jekyll-theme-primer (= 0.6.0) + jekyll-theme-slate (= 0.2.0) + jekyll-theme-tactile (= 0.2.0) + jekyll-theme-time-machine (= 0.2.0) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.13.0) + kramdown (= 2.4.0) + kramdown-parser-gfm (= 1.1.0) + liquid (= 4.0.4) + mercenary (~> 0.3) + minima (= 2.5.1) + nokogiri (>= 1.13.6, < 2.0) + rouge (= 3.30.0) + terminal-table (~> 1.4) + github-pages-health-check (1.18.2) + addressable (~> 2.3) + dnsruby (~> 1.60) + octokit (>= 4, < 8) + public_suffix (>= 3.0, < 6.0) + typhoeus (~> 1.3) + html-pipeline (2.14.3) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.8.0) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + jekyll (3.9.5) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (>= 0.7, < 2) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (>= 1.17, < 3) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-avatar (0.8.0) + jekyll (>= 3.0, < 5.0) + jekyll-coffeescript (1.2.2) + coffee-script (~> 2.2) + coffee-script-source (~> 1.12) + jekyll-commonmark (1.4.0) + commonmarker (~> 0.22) + jekyll-commonmark-ghpages (0.4.0) + commonmarker (~> 0.23.7) + jekyll (~> 3.9.0) + jekyll-commonmark (~> 1.4.0) + rouge (>= 2.0, < 5.0) + jekyll-default-layout (0.1.5) + jekyll (>= 3.0, < 5.0) + jekyll-feed (0.17.0) + jekyll (>= 3.7, < 5.0) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.16.1) + jekyll (>= 3.4, < 5.0) + octokit (>= 4, < 7, != 4.4.0) + jekyll-include-cache (0.2.1) + jekyll (>= 3.7, < 5.0) + jekyll-mentions (1.6.0) + html-pipeline (~> 2.3) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.7.0) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.3) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.6.0) + jekyll (> 3.5, < 5.0) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.2.0) + jekyll (> 3.5, < 5.0) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.13.0) + gemoji (>= 3, < 5) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + json (2.12.2) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.6) + mercenary (0.3.6) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.25.5) + net-http (0.6.0) + uri + nokogiri (1.18.8-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.8-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.8-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.8-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.8-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.8-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.8-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.8-x86_64-linux-musl) + racc (~> 1.4) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (5.1.1) + racc (1.8.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rexml (3.4.1) + rouge (3.30.0) + rubyzip (2.4.1) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + securerandom (0.4.1) + simpleidn (0.2.3) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (1.8.0) + uri (1.0.3) + webrick (1.9.1) + +PLATFORMS + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + github-pages + jekyll-relative-links + jekyll-remote-theme + jekyll-seo-tag + jekyll-sitemap + webrick (~> 1.7) + +BUNDLED WITH + 2.6.9 diff --git a/_config_docs.yml b/_config_docs.yml new file mode 100644 index 0000000000..cdc88fbb89 --- /dev/null +++ b/_config_docs.yml @@ -0,0 +1,33 @@ + +title: "Datadog Browser SDK Docs" +description: "API documentation for the Datadog Browser SDK." + +url: "https://datadoghq.dev" +baseurl: "/browser-sdk" + + +remote_theme: "just-the-docs/just-the-docs" + +just_the_docs: + search_enabled: true + nav_depth: 2 + +plugins: + - jekyll-remote-theme + - jekyll-seo-tag + - jekyll-sitemap + - jekyll-relative-links + +exclude: + - node_modules/ + - vendor/ + - Gemfile* + - package*.json + - yarn.lock + - _site/ + +defaults: + - scope: + path: "" + values: + layout: "default" diff --git a/docs/browser-logs.datadoglogs.md b/docs/browser-logs.datadoglogs.md new file mode 100644 index 0000000000..1484f0f44f --- /dev/null +++ b/docs/browser-logs.datadoglogs.md @@ -0,0 +1,20 @@ +--- +layout: default +title: "datadogLogs variable" +nav_order: 207 +permalink: /browser-logs.datadoglogs.html +--- + + + +Home > @datadog/browser-logs > datadogLogs + +## datadogLogs variable + +The global Logs instance. Use this to call Logs methods. + +**Signature:** + +```typescript +datadogLogs: LogsPublicApi +``` diff --git a/docs/browser-logs.handlertype.md b/docs/browser-logs.handlertype.md new file mode 100644 index 0000000000..b46b306e33 --- /dev/null +++ b/docs/browser-logs.handlertype.md @@ -0,0 +1,24 @@ +--- +layout: default +title: "HandlerType variable" +nav_order: 206 +permalink: /browser-logs.handlertype.html +--- + + + +Home > @datadog/browser-logs > HandlerType + +## HandlerType variable + +Defines the types of handlers for processing logs: console, HTTP, or silent. + +**Signature:** + +```typescript +HandlerType: { + readonly console: "console"; + readonly http: "http"; + readonly silent: "silent"; +} +``` diff --git a/docs/browser-logs.logger._constructor_.md b/docs/browser-logs.logger._constructor_.md new file mode 100644 index 0000000000..7483d7fb90 --- /dev/null +++ b/docs/browser-logs.logger._constructor_.md @@ -0,0 +1,118 @@ +--- +layout: default +title: "Logger.(constructor)" +nav_order: 205 +permalink: /browser-logs.logger._constructor_.html +--- + + + +Home > @datadog/browser-logs > Logger > (constructor) + +## Logger.(constructor) + +Constructs a new instance of the `Logger` class + +**Signature:** + +```typescript +constructor(handleLogStrategy: (logsMessage: LogsMessage, logger: Logger, handlingStack?: string) => void, name?: string, handlerType?: HandlerType | HandlerType[], level?: StatusType, loggerContext?: object); +``` + +## Parameters + +
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +handleLogStrategy + + + | + +(logsMessage: LogsMessage, logger: Logger, handlingStack?: string) => void + + + | + + + |
| + +name + + + | + +string + + + | + +(Optional) + + + |
| + +handlerType + + + | + +HandlerType | HandlerType\[\] + + + | + +(Optional) + + + |
| + +level + + + | + +StatusType + + + | + +(Optional) + + + |
| + +loggerContext + + + | + +object + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +status + + + | + +StatusType + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +status + + + | + +StatusType + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +handlingStack + + + | + +string + + + | + +(Optional) + + + |
| + +Method + + + | + +Description + + + |
|---|---|
| + +alert(message, messageContext, error) + + + | + +Add an ALERT log (action must be taken immediately). + + + |
| + +critical(message, messageContext, error) + + + | + +Add a CRITICAL log (serious failure). + + + |
| + +debug(message, messageContext, error) + + + | + +Add a DEBUG log (developer usage). + + + |
| + +emerg(message, messageContext, error) + + + | + +Add an EMERGENCY log (system is unusable). + + + |
| + +error(message, messageContext, error) + + + | + +Add an ERROR log (runtime error). + + + |
| + +info(message, messageContext, error) + + + | + +Add an INFO log (notable but expected). + + + |
| + +notice(message, messageContext, error) + + + | + +Add a NOTICE log (normal but significant). + + + |
| + +ok(message, messageContext, error) + + + | + +Add an OK log (success). + + + |
| + +warn(message, messageContext, error) + + + | + +Add a WARN log (unexpected behaviour). + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +key + + + | + +string + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +context + + + | + +object + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +key + + + | + +string + + + | + + + |
| + +value + + + | + +any + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +handler + + + | + +HandlerType | HandlerType\[\] + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +level + + + | + +StatusType + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +message + + + | + +string + + + | + + + |
| + +messageContext + + + | + +object + + + | + +(Optional) + + + |
| + +error + + + | + +Error + + + | + +(Optional) + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +context? + + + | + + + | + +object + + + | + +(Optional) + + + |
| + +handler? + + + | + + + | + +HandlerType | HandlerType\[\] + + + | + +(Optional) + + + |
| + +level? + + + | + + + | + +StatusType + + + | + +(Optional) + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +application_id? + + + | + + + | + +string + + + | + +(Optional) UUID of the application + + + |
| + +date + + + | + + + | + +number + + + | + +Start of the log in ms from epoch + + + |
| + +error? + + + | + + + | + +{ kind?: string; stack?: string; fingerprint?: string; message?: string; causes?: Array<{ message: string; source: string; type?: string; stack?: string; }>; \[k: string\]: unknown; } + + + | + +(Optional) Error properties + + + |
| + +http? + + + | + + + | + +{ method: 'POST' | 'GET' | 'HEAD' | 'PUT' | 'DELETE' | 'PATCH'; status_code: number; url: string; \[k: string\]: unknown; } + + + | + +(Optional) Resource properties of the error + + + |
| + +logger? + + + | + + + | + +{ name: string; \[k: string\]: unknown; } + + + | + +(Optional) Logger properties + + + |
| + +message + + + | + + + | + +string + + + | + +The log message + + + |
| + +origin + + + | + + + | + +'network' | 'source' | 'console' | 'logger' | 'agent' | 'report' + + + | + +Origin of the log + + + |
| + +service? + + + | + + + | + +string + + + | + +(Optional) The service name + + + |
| + +session_id? + + + | + + + | + +string + + + | + +(Optional) UUID of the session (deprecated in favor of session.id) + + + |
| + +session? + + + | + + + | + +{ id?: string; \[k: string\]: unknown; } + + + | + +(Optional) Session properties + + + |
| + +status + + + | + + + | + +'ok' | 'debug' | 'info' | 'notice' | 'warn' | 'error' | 'critical' | 'alert' | 'emerg' + + + | + +The log status + + + |
| + +view + + + | + + + | + +{ referrer?: string; url: string; id?: string; \[k: string\]: unknown; } + + + | + +View properties + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +clearAccount + + + | + + + | + +() => void + + + | + +Clear all account information + + + |
| + +clearGlobalContext + + + | + + + | + +() => void + + + | + +Clear the global context + +See \Overwrite context\ for further information. + + + |
| + +clearUser + + + | + + + | + +() => void + + + | + +Clear all user information + +See \User context\ for further information. + + + |
| + +createLogger + + + | + + + | + +(name: string, conf?: LoggerConfiguration) => Logger + + + | + +The Datadog browser logs SDK contains a default logger `DD_LOGS.logger`, but this API allows to create different ones. + +See \Define multiple loggers\ for further information. + + + |
| + +getAccount + + + | + + + | + +() => Context + + + | + +Get account information + + + |
| + +getGlobalContext + + + | + + + | + +() => Context + + + | + +Get the global Context + +See \Overwrite context\ for further information. + + + |
| + +getInitConfiguration + + + | + + + | + +() => LogsInitConfiguration | undefined + + + | + +Get the init configuration + + + |
| + +getInternalContext + + + | + + + | + +(startTime?: number) => InternalContext | undefined + + + | + +\[Internal API\] Get the internal SDK context + +See \Access internal context\ for further information. + + + |
| + +getLogger + + + | + + + | + +(name: string) => Logger | undefined + + + | + +Get a logger + +See \Define multiple loggers\ for further information. + + + |
| + +getUser + + + | + + + | + +() => Context + + + | + +Get user information + +See \User context\ for further information. + + + |
| + +init + + + | + + + | + +(initConfiguration: LogsInitConfiguration) => void + + + | + +Init the Logs browser SDK. + + + |
| + +logger + + + | + + + | + +Logger + + + | + + + |
| + +removeAccountProperty + + + | + + + | + +(key: string) => void + + + | + +Remove an account property + + + |
| + +removeGlobalContextProperty + + + | + + + | + +(key: any) => void + + + | + +Remove a global context property + +See \Overwrite context\ for further information. + + + |
| + +removeUserProperty + + + | + + + | + +(key: any) => void + + + | + +Remove a user property + +See \User context\ for further information. + + + |
| + +setAccount + + + | + + + | + +(newAccount: Account) => void + + + | + +Set account information to all events, stored in `@account` + + + |
| + +setAccountProperty + + + | + + + | + +(key: string, property: any) => void + + + |
+
+Set or update the account property, stored in `@account. |
| + +setGlobalContext + + + | + + + | + +(context: any) => void + + + | + +Set the global context information to all logs, stored in `@context` + + + |
| + +setGlobalContextProperty + + + | + + + | + +(key: any, value: any) => void + + + |
+
+Set or update a global context property, stored in `@context. |
| + +setTrackingConsent + + + | + + + | + +(trackingConsent: TrackingConsent) => void + + + | + +Set the tracking consent of the current user. + + + |
| + +setUserProperty + + + | + + + | + +(key: any, property: any) => void + + + |
+
+Set or update the user property, stored in `@usr. |
| + +Method + + + | + +Description + + + |
|---|---|
| + +setUser(newUser) + + + | + +Set user information to all events, stored in `@usr` + +See \User context\ for further information. + + + |
| + +setUser(newUser) + + + | + +Set user information to all events, stored in `@usr` + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +newUser + + + | + +User & { id: string; } + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +newUser + + + | + +User + + + | + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +beforeSend? + + + | + + + | + +((event: LogsEvent, context: LogsEventDomainContext) => boolean) | undefined + + + | + +(Optional) Access to every logs collected by the Logs SDK before they are sent to Datadog. It allows: - Enrich your logs with additional context attributes - Modify your logs to modify their content, or redact sensitive sequences (see the list of editable properties) - Discard selected logs + + + |
| + +forwardConsoleLogs? + + + | + + + | + +ConsoleApiName\[\] | 'all' | undefined + + + | + +(Optional) Forward logs from console.* to Datadog. Use "all" to forward everything or an array of console API names to forward only a subset. + + + |
| + +forwardErrorsToLogs? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Forward console.error logs, uncaught exceptions and network errors to Datadog. true + + + |
| + +forwardReports? + + + | + + + | + +RawReportType\[\] | 'all' | undefined + + + | + +(Optional) Forward reports from the \Reporting API\ to Datadog. Use "all" to forward everything or an array of report types to forward only a subset. + + + |
| + +usePciIntake? + + + | + + + | + +boolean + + + | + +(Optional) Use PCI-compliant intake. See \PCI DSS Compliance\ for further information. false + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +context? + + + | + + + | + +Context + + + | + +(Optional) Optional context attached to the log + + + |
| + +message + + + | + + + | + +string + + + | + +Raw message provided by the customer + + + |
| + +status + + + | + + + | + +StatusType + + + | + +Severity of the log + + + |
| + +Class + + + | + +Description + + + |
|---|---|
| + +Logger + + + | + + + |
| + +Interface + + + | + +Description + + + |
|---|---|
| + +Logger + + + | + +Provides convenience methods for logging at each supported level. Each method accepts a message, optional context, and an optional error. + + + |
| + +LoggerConfiguration + + + | + +Configuration options for a logger. Includes the log level to determine the severity of logs, the handler(s) responsible for processing log messages, and an optional context object to provide additional metadata for logs. + + + |
| + +LogsEvent + + + | + +Represents a log event collected by the Datadog Browser Logs SDK, containing information such as message, context, and metadata. + + + |
| + +LogsGlobal + + + | + +The public API for the Datadog Browser Logs SDK. Provides methods to initialize the SDK, manage global/user/account contexts, and interact with loggers for collecting and forwarding logs. + + + |
| + +LogsInitConfiguration + + + | + +Configuration options for initializing the Datadog Browser Logs SDK. Extends the base InitConfiguration and includes additional options specific to log collection, such as error forwarding, console log forwarding, and the ability to modify or discard logs before they are sent. + + + |
| + +LogsMessage + + + | + +Structure passed to the internal log handling strategy. + + + |
| + +Variable + + + | + +Description + + + |
|---|---|
| + +datadogLogs + + + | + +The global Logs instance. Use this to call Logs methods. + + + |
| + +HandlerType + + + | + +Defines the types of handlers for processing logs: console, HTTP, or silent. + + + |
| + +StatusType + + + | + +Defines the severity levels for log messages, ranging from debug to emergency. + + + |
| + +Type Alias + + + | + +Description + + + |
|---|---|
| + +HandlerType + + + | + + + |
| + +LogsEventDomainContext + + + | + + + |
| + +StatusType + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +error + + + | + +Error + + + | + + + |
| + +info + + + | + +ErrorInfo + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +props + + + | + +Props + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +error + + + | + +Error + + + | + + + |
| + +errorInfo + + + | + +ErrorInfo + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +error + + + | + +Error + + + | + + + |
| + +Constructor + + + | + +Modifiers + + + | + +Description + + + |
|---|---|---|
| + +(constructor)(props) + + + | + + + | + +Constructs a new instance of the `ErrorBoundary` class + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +resetError + + + | + + + | + +() => void + + + | + + + |
| + +Method + + + | + +Modifiers + + + | + +Description + + + |
|---|---|---|
| + +componentDidCatch(error, errorInfo) + + + | + + + | + + + |
| + +getDerivedStateFromError(error) + + + | + +`static` + + + | + + + |
| + +render() + + + | + + + | + + + |
| + +Class + + + | + +Description + + + |
|---|---|
| + +ErrorBoundary + + + | + +A React Error Boundary that captures runtime errors in its child components and reports them to Datadog RUM, rendering the `fallback` component when an error occurs. + + + |
| + +Function + + + | + +Description + + + |
|---|---|
| + +addReactError(error, info) + + + | + +Reports an error originating from React (Error Boundary or `componentDidCatch`) to Datadog RUM with relevant context and stack information. + + + |
| + +reactPlugin(configuration) + + + | + +Factory function that creates the React plugin for Datadog RUM, enabling features like ErrorBoundary integration, optional react-router view tracking, and component performance tracking utilities. + + + |
| + +Variable + + + | + +Description + + + |
|---|---|
| + +UNSTABLE_ReactComponentTracker + + + | + +Experimental component that tracks the render lifecycle of its children and reports a duration vital named `reactComponentRender`. + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +configuration + + + | + +ReactPluginConfiguration + + + | + +(Optional) + + + |
| + +Variable + + + | + +Description + + + |
|---|---|
| + +datadogRum + + + | + +The global RUM instance (slim version without Session Replay and Profiling). Use this to call RUM methods. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +_dd + + + | + +`readonly` + + + | + +{ readonly format_version: 2; session?: { plan?: 1 | 2; readonly session_precondition?: 'user_app_launch' | 'inactivity_timeout' | 'max_duration' | 'background_launch' | 'prewarm' | 'from_non_interactive_session' | 'explicit_stop'; \[k: string\]: unknown; }; readonly configuration?: { readonly session_sample_rate: number; readonly session_replay_sample_rate?: number; \[k: string\]: unknown; }; readonly browser_sdk_version?: string; \[k: string\]: unknown; } + + + | + +Internal properties + + + |
| + +account? + + + | + +`readonly` + + + | + +{ readonly id: string; readonly name?: string; \[k: string\]: unknown; } + + + | + +(Optional) Account properties + + + |
| + +application + + + | + +`readonly` + + + | + +{ readonly id: string; \[k: string\]: unknown; } + + + | + +Application properties + + + |
| + +build_id? + + + | + +`readonly` + + + | + +string + + + | + +(Optional) Generated unique ID of the application build. Unlike version or build_version this field is not meant to be coming from the user, but rather generated by the tooling for each build. + + + |
| + +build_version? + + + | + +`readonly` + + + | + +string + + + | + +(Optional) The build version for this application + + + |
| + +ci_test? + + + | + +`readonly` + + + | + +{ readonly test_execution_id: string; \[k: string\]: unknown; } + + + | + +(Optional) CI Visibility properties + + + |
| + +connectivity? + + + | + + + | + +{ readonly status: 'connected' | 'not_connected' | 'maybe'; readonly interfaces?: ('bluetooth' | 'cellular' | 'ethernet' | 'wifi' | 'wimax' | 'mixed' | 'other' | 'unknown' | 'none')\[\]; readonly effective_type?: 'slow-2g' | '2g' | '3g' | '4g'; readonly cellular?: { readonly technology?: string; readonly carrier_name?: string; \[k: string\]: unknown; }; \[k: string\]: unknown; } + + + | + +(Optional) Device connectivity properties + + + |
| + +context? + + + | + + + | + +{ \[k: string\]: unknown; } + + + | + +(Optional) User provided context + + + |
| + +date + + + | + +`readonly` + + + | + +number + + + | + +Start of the event in ms from epoch + + + |
| + +device? + + + | + + + | + +{ readonly type: 'mobile' | 'desktop' | 'tablet' | 'tv' | 'gaming_console' | 'bot' | 'other'; readonly name?: string; readonly model?: string; readonly brand?: string; readonly architecture?: string; \[k: string\]: unknown; } + + + | + +(Optional) Device properties + + + |
| + +display? + + + | + + + | + +{ readonly viewport?: { readonly width: number; readonly height: number; \[k: string\]: unknown; }; \[k: string\]: unknown; } + + + | + +(Optional) Display properties + + + |
| + +os? + + + | + + + | + +{ readonly name: string; readonly version: string; readonly build?: string; readonly version_major: string; \[k: string\]: unknown; } + + + | + +(Optional) Operating system properties + + + |
| + +service? + + + | + + + | + +string + + + | + +(Optional) The service name for this application + + + |
| + +session + + + | + +`readonly` + + + | + +{ readonly id: string; readonly type: 'user' | 'synthetics' | 'ci_test'; readonly has_replay?: boolean; \[k: string\]: unknown; } + + + | + +Session properties + + + |
| + +source? + + + | + +`readonly` + + + | + +'android' | 'ios' | 'browser' | 'flutter' | 'react-native' | 'roku' | 'unity' | 'kotlin-multiplatform' + + + | + +(Optional) The source of this event + + + |
| + +synthetics? + + + | + +`readonly` + + + | + +{ readonly test_id: string; readonly result_id: string; readonly injected?: boolean; \[k: string\]: unknown; } + + + | + +(Optional) Synthetics properties + + + |
| + +usr? + + + | + +`readonly` + + + | + +{ readonly id?: string; readonly name?: string; readonly email?: string; readonly anonymous_id?: string; \[k: string\]: unknown; } + + + | + +(Optional) User properties + + + |
| + +version? + + + | + + + | + +string + + + | + +(Optional) The version for this application + + + |
| + +view + + + | + +`readonly` + + + | + +{ readonly id: string; referrer?: string; url: string; name?: string; \[k: string\]: unknown; } + + + | + +View properties + + + |
| + +Interface + + + | + +Description + + + |
|---|---|
| + +CommonProperties + + + | + +Schema of common properties of RUM events + + + |
| + +RumActionEventDomainContext + + + | + +Additional information available when the SDK dispatches a RUM Action event. + + + |
| + +RumErrorEventDomainContext + + + | + +Additional information available when the SDK dispatches an Error event. + + + |
| + +RumFetchResourceEventDomainContext + + + | + +Additional information available when the SDK dispatches a Fetch resource event. + + + |
| + +RumGlobal + + + | + +The RUM Browser SDK global object that provides all the public methods. + + + |
| + +RumInitConfiguration + + + | + +Configuration options to pass to the `init()` method when initializing the RUM SDK. + + + |
| + +RumLongTaskEventDomainContext + + + | + +Additional information available when the SDK dispatches a Long Task event. + + + |
| + +RumOtherResourceEventDomainContext + + + | + +Additional information available when the SDK dispatches a Resource event that is neither fetch nor XHR. + + + |
| + +RumViewEventDomainContext + + + | + +Additional information available when the SDK dispatches a RUM View event. + + + |
| + +RumXhrResourceEventDomainContext + + + | + +Additional information available when the SDK dispatches an XHR resource event. + + + |
| + +Variable + + + | + +Description + + + |
|---|---|
| + +datadogRum + + + | + +The global RUM instance. Use this to call RUM methods. + + + |
| + +Type Alias + + + | + +Description + + + |
|---|---|
| + +RumActionEvent + + + | + +Schema of all properties of an Action event + + + |
| + +RumErrorEvent + + + | + +Schema of all properties of an Error event + + + |
| + +RumEvent + + + | + +Schema of all properties of a RUM event + + + |
| + +RumEventDomainContext + + + | + +Additional context data that varies based on the type of RUM event being dispatched. + + + |
| + +RumLongTaskEvent + + + | + +Schema of all properties of a Long Task event + + + |
| + +RumResourceEvent + + + | + +Schema of all properties of a Resource event + + + |
| + +RumViewEvent + + + | + +Schema of all properties of a View event + + + |
| + +RumVitalEvent + + + | + +Schema of all properties of a Vital event + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +events? + + + | + + + | + +Event\[\] + + + | + +(Optional) DOM events that triggered this action. + + + |
| + +handlingStack? + + + | + + + | + +string + + + | + +(Optional) Stack trace of where the action was handled by the SDK. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +error + + + | + + + | + +unknown + + + | + +The original error object that was captured. + + + |
| + +handlingStack? + + + | + + + | + +string + + + | + +(Optional) Stack trace of where the error was handled by the SDK. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +error? + + + | + + + | + +Error + + + | + +(Optional) Error that occurred during the fetch call. + + + |
| + +handlingStack? + + + | + + + | + +string + + + | + +(Optional) Stack trace of where the resource was handled by the SDK. + + + |
| + +isAborted + + + | + + + | + +boolean + + + | + +Whether the fetch call was aborted. + + + |
| + +performanceEntry? + + + | + + + | + +PerformanceEntry + + + | + +(Optional) Browser performance entry for this resource. + + + |
| + +requestInit? + + + | + + + | + +RequestInit + + + | + +(Optional) Init object passed to the fetch call. + + + |
| + +requestInput + + + | + + + | + +RequestInfo + + + | + +Input parameter passed to the fetch call. + + + |
| + +response? + + + | + + + | + +Response + + + | + +(Optional) Response object returned by the fetch call. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +addAction + + + | + + + | + +(name: string, context?: object) => void + + + | + +Add a custom action, stored in `@action` + + + |
| + +addDurationVital + + + | + + + | + +(name: string, options: { startTime: number; duration: number; context?: object; description?: string; }) => void + + + | + +Add a custom duration vital + + + |
| + +addError + + + | + + + | + +(error: unknown, context?: object) => void + + + | + +Add a custom error, stored in `@error`. + + + |
| + +addFeatureFlagEvaluation + + + | + + + | + +(key: string, value: any) => void + + + |
+
+Add a feature flag evaluation, stored in `@feature_flags. |
| + +addTiming + + + | + + + | + +(name: string, time?: number) => void + + + |
+
+Add a custom timing relative to the start of the current view, stored in `@view.custom_timings. |
| + +clearAccount + + + | + + + | + +() => void + + + | + +Clear all account information + + + |
| + +clearGlobalContext + + + | + + + | + +() => void + + + | + +Clear the global context + +See \Global context\ for further information. + + + |
| + +clearUser + + + | + + + | + +() => void + + + | + +Clear all user information + +See \User session\ for further information. + + + |
| + +getAccount + + + | + + + | + +() => Context + + + | + +Get account information + + + |
| + +getGlobalContext + + + | + + + | + +() => Context + + + | + +Get the global Context + +See \Global context\ for further information. + + + |
| + +getInitConfiguration + + + | + + + | + +() => RumInitConfiguration | undefined + + + | + +Get the init configuration + + + |
| + +getInternalContext + + + | + + + | + +(startTime?: number) => InternalContext | undefined + + + | + +\[Internal API\] Get the internal SDK context + + + |
| + +getSessionReplayLink + + + | + + + | + +() => string | undefined + + + | + +Get the Session Replay Link. + +See \Connect Session Replay To Your Third-Party Tools\ for further information. + + + |
| + +getUser + + + | + + + | + +() => Context + + + | + +Get user information + +See \User session\ for further information. + + + |
| + +getViewContext + + + | + + + | + +() => Context + + + | + +Get View Context. + + + |
| + +init + + + | + + + | + +(initConfiguration: RumInitConfiguration) => void + + + | + +Init the RUM browser SDK. + + + |
| + +removeAccountProperty + + + | + + + | + +(key: string) => void + + + | + +Remove an account property + + + |
| + +removeGlobalContextProperty + + + | + + + | + +(key: any) => void + + + | + +Remove a global context property + +See \Global context\ for further information. + + + |
| + +removeUserProperty + + + | + + + | + +(key: any) => void + + + | + +Remove a user property + +See \User session\ for further information. + + + |
| + +setAccount + + + | + + + | + +(newAccount: Account) => void + + + | + +Set account information to all events, stored in `@account` + + + |
| + +setAccountProperty + + + | + + + | + +(key: string, property: any) => void + + + |
+
+Set or update the account property, stored in `@account. |
| + +setGlobalContext + + + | + + + | + +(context: any) => void + + + | + +Set the global context information to all events, stored in `@context` + + + |
| + +setGlobalContextProperty + + + | + + + | + +(key: any, value: any) => void + + + |
+
+Set or update a global context property, stored in `@context. |
| + +setTrackingConsent + + + | + + + | + +(trackingConsent: TrackingConsent) => void + + + | + +Set the tracking consent of the current user. + + + |
| + +setUserProperty + + + | + + + | + +(key: any, property: any) => void + + + |
+
+Set or update the user property, stored in `@usr. |
| + +setViewContext + + + | + + + | + +(context: Context) => void + + + | + +Set View Context. + +Enable to manually set the context of the current view. + + + |
| + +setViewContextProperty + + + | + + + | + +(key: string, value: any) => void + + + | + +Set View Context Property. + +Enable to manually set a property of the context of the current view. + + + |
| + +setViewName + + + | + + + | + +(name: string) => void + + + | + +Set View Name. + +Enable to manually change the name of the current view. + + + |
| + +startDurationVital + + + | + + + | + +(name: string, options?: { context?: object; description?: string; }) => DurationVitalReference + + + | + +Start a custom duration vital. + +If you plan to have multiple durations for the same vital, you should use the reference returned by this method. + + + |
| + +startSessionReplayRecording + + + | + + + | + +(options?: StartRecordingOptions) => void + + + | + +Start Session Replay recording. Enable to conditionally start the recording, use the `startSessionReplayRecordingManually:true` init parameter and call `startSessionReplayRecording()` + +See \Browser Session Replay\ for further information. + + + |
| + +startView + + + | + + + | + +{ (name?: string): void; (options: ViewOptions): void; } + + + | + +Start a view manually. Enable to manual start a view, use `trackViewsManually: true` init parameter and call `startView()` to create RUM views and be aligned with how you've defined them in your SPA application routing. + + + |
| + +stopDurationVital + + + | + + + | + +(nameOrRef: string | DurationVitalReference, options?: { context?: object; description?: string; }) => void + + + | + +Stop a custom duration vital + + + |
| + +stopSession + + + | + + + | + +() => void + + + | + +Stop the session. A new session will start at the next user interaction with the page. + + + |
| + +stopSessionReplayRecording + + + | + + + | + +() => void + + + | + +Stop Session Replay recording. + +See \Browser Session Replay\ for further information. + + + |
| + +Method + + + | + +Description + + + |
|---|---|
| + +setUser(newUser) + + + | + +Set user information to all events, stored in `@usr` + +See \User session\ for further information. + + + |
| + +setUser(newUser) + + + | + +Set user information to all events, stored in `@usr` + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +newUser + + + | + +User & { id: string; } + + + | + + + |
| + +Parameter + + + | + +Type + + + | + +Description + + + |
|---|---|---|
| + +newUser + + + | + +User + + + | + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +actionNameAttribute? + + + | + + + | + +string | undefined + + + | + +(Optional) Specify your own attribute to use to name actions. See Declare a name for click actions for further information. + + + |
| + +allowedTracingUrls? + + + | + + + | + +Array<MatchOption | TracingOption> | undefined + + + | + +(Optional) A list of request URLs used to inject tracing headers. See Connect RUM and Traces for further information. + + + |
| + +applicationId + + + | + + + | + +string + + + | + +The RUM application ID. + + + |
| + +beforeSend? + + + | + + + | + +((event: RumEvent, context: RumEventDomainContext) => boolean) | undefined + + + | + +(Optional) Access to every event collected by the RUM SDK before they are sent to Datadog. It allows: - Enrich your RUM events with additional context attributes - Modify your RUM events to modify their content, or redact sensitive sequences (see the list of editable properties) - Discard selected RUM events + +See Enrich And Control Browser RUM Data With beforeSend for further information. + + + |
| + +compressIntakeRequests? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Compress requests sent to the Datadog intake to reduce bandwidth usage when sending large amounts of data. The compression is done in a Worker thread. See Content Security Policy guidelines for further information. + + + |
| + +defaultPrivacyLevel? + + + | + + + | + +DefaultPrivacyLevel | undefined + + + | + +(Optional) Allow to protect end user privacy and prevent sensitive organizational information from being collected. mask See Replay Privacy Options for further information. + + + |
| + +enablePrivacyForActionName? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Enables privacy control for action names. + + + |
| + +excludedActivityUrls? + + + | + + + | + +MatchOption\[\] | undefined + + + | + +(Optional) A list of request origins ignored when computing the page activity. See How page activity is calculated for further information. + + + |
| + +plugins? + + + | + + + | + +RumPlugin\[\] | undefined + + + | + +(Optional) List of plugins to enable. The plugins API is unstable and experimental, and may change without notice. Please use only plugins provided by Datadog matching the version of the SDK you are using. + + + |
| + +profilingSampleRate? + + + | + + + | + +number | undefined + + + | + +(Optional) Not ready for production. The percentage of users profiled. A value between 0 and 100. 0 + + + |
| + +propagateTraceBaggage? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Whether to propagate user and account IDs in the baggage header of trace requests. false + + + |
| + +remoteConfigurationId? + + + | + + + | + +string | undefined + + + | + +(Optional) Identifier of the remote configuration to fetch dynamic settings for your application at runtime. Unless you have been instructed by Datadog support to use this feature, you should leave this parameter undefined. + + + |
| + +sessionReplaySampleRate? + + + | + + + | + +number | undefined + + + | + +(Optional) The percentage of tracked sessions with \Browser RUM & Session Replay pricing\ features: 100 for all, 0 for none. See Configure Your Setup For Browser RUM and Browser RUM & Session Replay Sampling for further information. + + + |
| + +startSessionReplayRecordingManually? + + + | + + + | + +boolean | undefined + + + | + +(Optional) If the session is sampled for Session Replay, only start the recording when `startSessionReplayRecording()` is called, instead of at the beginning of the session. Default: if startSessionReplayRecording is 0, true; otherwise, false. See Session Replay Usage for further information. + + + |
| + +subdomain? + + + | + + + | + +string + + + | + +(Optional) If you are accessing Datadog through a custom subdomain, you can set `subdomain` to include your custom domain in the `getSessionReplayLink()` returned URL . See Connect Session Replay To Your Third-Party Tools for further information. + + + |
| + +traceContextInjection? + + + | + + + | + +TraceContextInjection | undefined + + + | + +(Optional) If you set a `traceSampleRate`, to ensure backend services' sampling decisions are still applied, configure the `traceContextInjection` initialization parameter to sampled. sampled See Connect RUM and Traces for further information. + + + |
| + +traceSampleRate? + + + | + + + | + +number | undefined + + + | + +(Optional) The percentage of requests to trace: 100 for all, 0 for none. See Connect RUM and Traces for further information. + + + |
| + +trackFeatureFlagsForEvents? + + + | + + + | + +FeatureFlagsForEvents\[\] + + + | + +(Optional) Enables collection of features flags in chosen events. + + + |
| + +trackLongTasks? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Enables collection of long task events. true + + + |
| + +trackResources? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Enables collection of resource events. true + + + |
| + +trackUserInteractions? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Enables automatic collection of users actions. See Tracking User Actions for further information. true + + + |
| + +trackViewsManually? + + + | + + + | + +boolean | undefined + + + | + +(Optional) Allows you to control RUM views creation. See Override default RUM view names for further information. + + + |
| + +workerUrl? + + + | + + + | + +string + + + | + +(Optional) URL pointing to the Datadog Browser SDK Worker JavaScript file. The URL can be relative or absolute, but is required to have the same origin as the web application. See Content Security Policy guidelines for further information. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +performanceEntry + + + | + + + | + +PerformanceEntry + + + | + +Browser performance entry for this long task. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +performanceEntry + + + | + + + | + +PerformanceEntry + + + | + +Browser performance entry for this resource. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +location + + + | + + + | + +Readonly<Location> + + + | + +The browser location object at the time the view was created. + + + |
| + +Property + + + | + +Modifiers + + + | + +Type + + + | + +Description + + + |
|---|---|---|---|
| + +handlingStack? + + + | + + + | + +string + + + | + +(Optional) Stack trace of where the resource was handled by the SDK. + + + |
| + +isAborted + + + | + + + | + +boolean + + + | + +Whether the XHR request was aborted. + + + |
| + +performanceEntry? + + + | + + + | + +PerformanceEntry + + + | + +(Optional) Browser performance entry for this resource. + + + |
| + +xhr + + + | + + + | + +XMLHttpRequest + + + | + +The XMLHttpRequest object that made the request. + + + |
| + +Package + + + | + +Description + + + |
|---|---|
| + +@datadog/browser-logs + + + | + +Datadog Browser Logs SDK for collecting and forwarding browser logs to Datadog. Provides comprehensive logging capabilities with automatic error tracking and custom log collection. + + + |
| + +@datadog/browser-rum + + + | + +Datadog Browser RUM SDK - Full version with Session Replay and Real User Profiling capabilities. Use this package to monitor your web application's performance and user experience. + + + |
| + +@datadog/browser-rum-react + + + | + +Datadog Browser RUM React Integration - Additional components and hooks for React applications. Provides React-specific features like Error Boundaries and component performance tracking. + + + |
| + +@datadog/browser-rum-slim + + + | + +Datadog Browser RUM SDK - Slim version without Session Replay and Real User Profiling. Lightweight alternative for basic RUM monitoring with reduced bundle size. + + + |