[RUM] monitor-your-nextjs-app-with-rum.md: site values and CDN URLs are hardcoded and don't respond to the Datadog Site selector

Open Beginner friendly
#35,446 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
hugo, javascript, nextjs

Research direction

Start with content/en/real_user_monitoring/guide/monitor-your-nextjs-app-with-rum.md and compare the parameter usage in proxy-rum-data.mdoc.md and client.mdoc.md. Convert the guide to the mdoc format and inspect all App Router and Pages Router npm and CDN tabs. Done means the selected Datadog Site supplies the site value and CDN URL without duplicating code blocks.

Written by the indexing model from the issue text.

Description

Problem

content/en/real_user_monitoring/guide/monitor-your-nextjs-app-with-rum.md hardcodes site: 'datadoghq.com' and the US1 CDN URL (https://www.datadoghq-browser-agent.com/us1/v6/datadog-rum.js) in all code examples, regardless of which Datadog Site is selected in the page selector.

This might lead to errors when copy-pasting the init block, even with the proper Datadog Site selected in the UI.

Affected code blocks (6 total across App Router and Pages Router sections):

  • npm tabs: site: "datadoghq.com" hardcoded
  • CDN async tabs: hardcoded site: + US1 CDN URL
  • CDN sync tabs: hardcoded site: + US1 CDN URL

Proposed fix

Convert the file from .md to .mdoc.md format, consistent with proxy-rum-data.mdoc.md and client.mdoc.md. This allows using {% region-param key="dd_site" /%} directly inside code blocks, keeping a single code block per tab instead of duplicating content across all 7 regions.

Dominant language
JavaScript
Stars
618
Forks
1.3k
Avg merge
2d 5h
Merged PRs (30d)
471

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataDog/documentation

All issues in DataDog/documentation

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.