✨ Add @datadog/browser-sdk-endpoint package and CDN bundle generator CLI#4241
Closed
mormubis wants to merge 1 commit into
Closed
✨ Add @datadog/browser-sdk-endpoint package and CDN bundle generator CLI#4241mormubis wants to merge 1 commit into
mormubis wants to merge 1 commit into
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 5e90dd5 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
This was referenced Feb 25, 2026
Introduces two artifacts for build-time SDK bundle generation: ### @datadog/browser-sdk-endpoint (Node.js package) - generateBundle(options) — high-level orchestrator: fetch config → download SDK → combine - fetchConfig(options) — wraps fetchRemoteConfiguration with 30s AbortSignal timeout - downloadSDK(options) — downloads SDK from Datadog CDN; in-memory cache keyed by variant+datacenter for watch mode (<5ms cache hit vs ~500ms network) - generateCombinedBundle(options) — low-level: combine SDK text + config into IIFE bundle - clearSdkCache() — test utility to reset the cache ### CLI: scripts/build/generate-cdn-bundle.ts Entry point for the generate-cdn-bundle script. Accepts --applicationId, --configId, --variant flags; outputs bundle to file or stdout.
ae5fb37 to
5e90dd5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Build tools (webpack, Vite, Node.js scripts) need a programmatic API to generate CDN bundles with embedded remote configuration. This PR adds that API as a published Node.js package, plus a CLI wrapper.
Changes
New package:
@datadog/browser-sdk-endpointgenerateBundle(options)— high-level async function with full input validationfetchConfig(options)— fetches remote config (delegates to@datadog/browser-remote-config)downloadSDK(options)— downloads SDK from Datadog CDN with in-memory caching (keyed by variant+datacenter; avoids re-fetching during watch mode)generateCombinedBundle(options)— low-level combinator: wraps SDK + config in an IIFEclearSdkCache()— test utilityCLI:
scripts/build/generate-cdn-bundle.tsInfrastructure
tsconfig.base.jsonpath alias for@datadog/browser-sdk-endpointTesting