Skip to content

✨ Add @datadog/browser-remote-config standalone package#4239

Draft
mormubis wants to merge 3 commits intoadlrb/ssi-build-site-hostfrom
adlrb/ssi-remote-config
Draft

✨ Add @datadog/browser-remote-config standalone package#4239
mormubis wants to merge 3 commits intoadlrb/ssi-build-site-hostfrom
adlrb/ssi-remote-config

Conversation

@mormubis
Copy link
Contributor

Motivation

Customers using SSI (Server-Side Instrumentation) need to fetch remote configuration independently of the RUM SDK, at build time or server-side. This package provides that capability as a standalone, lightweight module.

Changes

New package: @datadog/browser-remote-config

  • fetchRemoteConfiguration(options) — fetch remote config with 30s timeout
  • RemoteConfigResult — discriminated union ({ ok: true; value } | { ok: false; error }) for safe TypeScript narrowing without non-null assertions
  • AbortSignal support — pass a signal for cancellation (e.g. AbortSignal.timeout(30_000))
  • Dynamic value resolution — cookies ($cookie:name), DOM selectors ($dom:selector), JS paths ($js:path)
  • Uses buildSiteHost from @datadog/browser-core (PR1) — no type-assertion hack

Purely additive

rum-core's existing remoteConfigurationId init option is untouched. This PR only adds the new package.

Testing

yarn test:unit --spec packages/remote-config/src/remoteConfiguration.spec.ts
yarn test:unit --spec packages/remote-config/src/jsonPathParser.spec.ts
yarn typecheck

Part of SSI Phase 6 stacked PRs. Stacks on: ♻️ Extract buildSiteHost (#4238). Next: @datadog/browser-sdk-endpoint package.

Introduces a new lightweight package for fetching and parsing Datadog
remote configuration, independent of the RUM SDK.

Key features:
- fetchRemoteConfiguration(options) — fetch config with 30s AbortSignal timeout
- RemoteConfigResult discriminated union: { ok: true; value } | { ok: false; error }
  for proper TypeScript narrowing (no non-null assertions needed)
- AbortSignal support for request cancellation
- Dynamic value resolution: cookies, DOM selectors, JS paths
- Uses buildSiteHost from @datadog/browser-core (no type-assertion hack)

This is purely additive — rum-core's existing remote config code is untouched.
Customers can use this package independently of the RUM SDK.
@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Feb 25, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum N/A 172.30 KiB N/A N/A N/A
Rum Profiler N/A 4.71 KiB N/A N/A N/A
Rum Recorder N/A 24.88 KiB N/A N/A N/A
Logs N/A 56.30 KiB N/A N/A N/A
Flagging N/A 944 B N/A N/A N/A
Rum Slim N/A 128.07 KiB N/A N/A N/A
Worker N/A 23.63 KiB N/A N/A N/A
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
addglobalcontext N/A 0.0043 N/A
addaction N/A 0.015 N/A
adderror N/A 0.0135 N/A
addtiming N/A 0.003 N/A
startview N/A 0.0145 N/A
startstopsessionreplayrecording N/A 0.0007 N/A
logmessage N/A 0.0158 N/A
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
addglobalcontext N/A 27.38 KiB N/A
addaction N/A 115.83 KiB N/A
addtiming N/A 26.63 KiB N/A
adderror N/A 116.61 KiB N/A
startstopsessionreplayrecording N/A 25.94 KiB N/A
startview N/A 502.27 KiB N/A
logmessage N/A 45.25 KiB N/A

🔗 RealWorld

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Feb 25, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 75.58%
Overall Coverage: 77.16%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 98db6c2 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant