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.