From 69b8444e68354d1360484510e8a5092002408614 Mon Sep 17 00:00:00 2001 From: Carlos Nogueira Date: Thu, 19 Mar 2026 18:28:06 +0000 Subject: [PATCH] Update `MIGRATION.md` to include changes to `firstPartyHosts` configuration option --- MIGRATION.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index f37fa23bc..af103d2e0 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -101,7 +101,7 @@ const configuration = new DatadogProviderConfiguration( | `nativeCrashReportEnabled` | `RumConfiguration` | Moved. | | `nativeViewTracking` | `RumConfiguration` | Moved. | | `nativeInteractionTracking` | `RumConfiguration` | Moved. | -| `firstPartyHosts` | `RumConfiguration` | Moved. | +| `firstPartyHosts` | `RumConfiguration` | Moved. Format changed from `(string \| FirstPartyHost)[]` to `FirstPartyHost[]`. | | `telemetrySampleRate` | `RumConfiguration` | Moved. | | `nativeLongTaskThresholdMs` | `RumConfiguration` | Moved. | | `longTaskThresholdMs` | `RumConfiguration` | Moved. | @@ -124,6 +124,46 @@ const configuration = new DatadogProviderConfiguration( | `trackResources` | `RumConfiguration` | Moved. | | `trackErrors` | `RumConfiguration` | Moved. | +### `firstPartyHosts` format change + +In v2, `firstPartyHosts` accepted an array of strings: + +```typescript +const config = { + firstPartyHosts: ['example.com', 'api.myapp.com'] +}; +``` + +In v3, `firstPartyHosts` has been moved to `rumConfiguration` and now requires an array of objects specifying the host and propagator types: + +```typescript +import { PropagatorType } from '@datadog/mobile-react-native'; + +const config = new CoreConfiguration( + CLIENT_TOKEN, + ENVIRONMENT, + TrackingConsent.GRANTED, + { + rumConfiguration: { + applicationId: APPLICATION_ID, + firstPartyHosts: [ + { + match: 'example.com', + propagatorTypes: [ + PropagatorType.DATADOG, + PropagatorType.TRACECONTEXT + ] + }, + { + match: 'api.myapp.com', + propagatorTypes: [PropagatorType.DATADOG] + } + ] + } + } +); +``` + ### FileBasedConfiguration changes FileBasedConfiguration now requires a path to a configuration JSON file instead of trying to find a default `datadog-configuration.json` at the app's root level like it did on v2.