Skip to content

feat(core): expose createFlagEvaluationEndpointBuilder for external SDK packages#4528

Closed
typotter wants to merge 2 commits into
mainfrom
typo/flag-evaluation-endpoint-builder
Closed

feat(core): expose createFlagEvaluationEndpointBuilder for external SDK packages#4528
typotter wants to merge 2 commits into
mainfrom
typo/flag-evaluation-endpoint-builder

Conversation

@typotter

Copy link
Copy Markdown
Contributor

Problem

External packages (specifically @datadog/openfeature-browser in DataDog/openfeature-js-client) need to build intake endpoint URLs for the flagevaluation track type. Currently there is no public API for this — the package resorts to a deep private subpath import (@datadog/browser-core/cjs/domain/configuration) to access createEndpointBuilder directly.

Solution

Add a purpose-specific public wrapper createFlagEvaluationEndpointBuilder instead of exporting the generic createEndpointBuilder.

This approach:

  • Hides TrackType and the 'flagevaluation' literal from external callers
  • Provides a single point of change if the track type name ever changes
  • Keeps createEndpointBuilder and TrackType off the public surface of @datadog/browser-core

Changes

packages/core/src/domain/configuration/endpointBuilder.ts

  • Updated comment on TrackType to reference the new public function
  • Added createFlagEvaluationEndpointBuilder as an exported function

packages/core/src/domain/configuration/index.ts

  • Added createFlagEvaluationEndpointBuilder to the internal barrel

packages/core/src/index.ts

  • Added createFlagEvaluationEndpointBuilder to public exports
  • Removed createEndpointBuilder and TrackType from public exports (kept internal)
  • EndpointBuilder type remains exported so consumers can annotate variables

Notes

  • A companion PR in DataDog/openfeature-js-client (TBD) will update @datadog/openfeature-browser to use this function instead of the deep subpath import.
  • createEndpointBuilder and TrackType remain available from the internal barrel for use by other packages in this repo.

External packages like @datadog/openfeature-browser need to build intake
endpoint URLs for the flagevaluation track. Rather than exporting the
generic createEndpointBuilder (which leaks TrackType), expose a
purpose-specific wrapper so callers have a stable, narrowly-scoped API.
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Apr 27, 2026

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 179.27 KiB 179.27 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.65 KiB 56.65 KiB 0 B 0.00%
Rum Slim 135.11 KiB 135.11 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0041 0.0081 +97.56%
RUM - add action 0.0148 0.0255 +72.30%
RUM - add error 0.0147 0.0173 +17.69%
RUM - add timing 0.0029 0.0062 +113.79%
RUM - start view 0.0136 0.0202 +48.53%
RUM - start/stop session replay recording 0.0008 0.0016 +100.00%
Logs - log message 0.0205 0.0275 +34.15%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 31.59 KiB 32.39 KiB +810 B
RUM - add action 105.36 KiB 105.52 KiB +164 B
RUM - add timing 32.19 KiB 33.07 KiB +900 B
RUM - add error 100.26 KiB 98.73 KiB -1.53 KiB
RUM - start/stop session replay recording 32.95 KiB 31.84 KiB -1.11 KiB
RUM - start view 497.39 KiB 492.70 KiB -4.69 KiB
Logs - log message 96.01 KiB 100.36 KiB +4.35 KiB

🔗 RealWorld

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Apr 27, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 77.01% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4a5b386 | Docs | Datadog PR Page | Give us feedback!

@typotter

Copy link
Copy Markdown
Contributor Author

Closing — investigation revealed flagEvaluationEndpointBuilder is already part of TransportConfiguration (since PR #3976) and available via validateAndBuildConfiguration. The explicit createEndpointBuilder call in openfeature-js-client was dead code overridden by ...baseConfiguration spread. No new public API needed.

@typotter typotter closed this Apr 27, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant