---
isPrivate: true
title: Integrated Libraries
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Client SDKs > Integrated Libraries
---

# Integrated Libraries

## Overview{% #overview %}

The Datadog SDK supports integration with third-party libraries to extend its functionality.

{% section
   displayed-if="The selected value for SDK is included in the given list: 'Browser, Roku, Unity'" %}
This section only applies to users who meet the following criteria: The selected value for SDK is included in the given list: 'Browser, Roku, Unity'

{% alert level="info" %}
Integrated libraries are not available for the selected SDK.
{% /alert %}
{% /section %}

{% section displayed-if="SDK is Android" %}
This section only applies to users who meet the following criteria: SDK is Android

This page lists integrated libraries you can use for Android and Android TV applications.

## Coil{% #coil %}

If you use Coil to load images in your application, see Datadog's [dedicated Coil library](https://github.com/DataDog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-coil).

## Fresco{% #fresco %}

If you use Fresco to load images in your application, see Datadog's [dedicated Fresco library](https://github.com/DataDog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-fresco).

## Glide{% #glide %}

If you use Glide to load images in your application, see Datadog's [dedicated Glide library](https://github.com/DataDog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-glide).

## Jetpack Compose{% #jetpack-compose %}

If you use Jetpack Compose in your application, see Datadog's [dedicated Jetpack Compose library](https://github.com/Datadog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-compose).

## RxJava{% #rxjava %}

If you use RxJava in your application, see Datadog's [dedicated RxJava library](https://github.com/Datadog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-rx).

## Picasso{% #picasso %}

If you use Picasso, use it with the `OkHttpClient` that's been instrumented with the Datadog SDK for RUM and APM information about network requests made by Picasso.

{% tab title="Kotlin" %}

```
val picasso = Picasso.Builder(context)
   .downloader(OkHttp3Downloader(okHttpClient))
   // …
   .build()
Picasso.setSingletonInstance(picasso)
```

{% /tab %}

{% tab title="Java" %}

```
final Picasso picasso = new Picasso.Builder(context)
   .downloader(new OkHttp3Downloader(okHttpClient))
   // …
   .build();
Picasso.setSingletonInstance(picasso);
```

{% /tab %}

## Retrofit{% #retrofit %}

If you use Retrofit, use it with the `OkHttpClient` that's been instrumented with the Datadog SDK for RUM and APM information about network requests made with Retrofit.

{% tab title="Kotlin" %}

```
val retrofitClient = Retrofit.Builder()
   .client(okHttpClient)
   // …
   .build()
```

{% /tab %}

{% tab title="Java" %}

```
final Retrofit retrofitClient = new Retrofit.Builder()
   .client(okHttpClient)
   // …
   .build();
```

{% /tab %}

## SQLDelight{% #sqldelight %}

If you use SQLDelight in your application, see Datadog's [dedicated SQLDelight library](https://github.com/DataDog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-sqldelight).

## SQLite{% #sqlite %}

Following SQLiteOpenHelper's [generated API documentation](https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper), you only have to provide the implementation of the `DatabaseErrorHandler` -> `DatadogDatabaseErrorHandler` in the constructor.

Doing this detects whenever a database is corrupted and sends a relevant RUM error event for it.

{% tab title="Kotlin" %}

```
class <YourOwnSqliteOpenHelper>: SqliteOpenHelper(
                                 <Context>,
                                 <DATABASE_NAME>,
                                 <CursorFactory>,
                                 <DATABASE_VERSION>,
                                 DatadogDatabaseErrorHandler()) {
   // …

}
```

{% /tab %}

{% tab title="Java" %}

```
public class <YourOwnSqliteOpenHelper> extends SqliteOpenHelper {
   public <YourOwnSqliteOpenHelper>(){
         super(<Context>,
               <DATABASE_NAME>,
               <CursorFactory>,
               <DATABASE_VERSION>,
               new DatadogDatabaseErrorHandler());
   }
}
```

{% /tab %}

## Apollo (GraphQL){% #apollo--graphql %}

If you use Apollo (GraphQL) in your application, see Datadog's [dedicated library with extensions for Apollo](https://github.com/DataDog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-apollo) and [Android advanced network configuration](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/android/advanced_configuration.md?tab=kotlin#apollo-instrumentation).

## Android TV (Leanback){% #android-tv--leanback %}

If you use the Leanback API to add actions into your Android TV application, see Datadog's [dedicated Android TV library](https://github.com/DataDog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-tv).

## Kotlin Coroutines{% #kotlin-coroutines %}

If you use Kotlin Coroutines, see Datadog's [dedicated library with extensions for RUM](https://github.com/Datadog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-rum-coroutines) and with [extensions for Trace](https://github.com/Datadog/dd-sdk-android/tree/develop/integrations/dd-sdk-android-trace-coroutines).
{% /section %}

{% section displayed-if="SDK is iOS" %}
This section only applies to users who meet the following criteria: SDK is iOS

This page lists integrated libraries you can use for iOS and tvOS applications.

## Alamofire{% #alamofire %}

Starting from version `3.7.0`, the RUM iOS SDK automatically tracks [Alamofire](https://github.com/Alamofire/Alamofire) requests after you enable RUM with `urlSessionTracking` configuration.

1. Configure RUM monitoring by following the [Setup](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/setup.md) guide.
1. *(Optional)* For **detailed timing breakdown** (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable `URLSessionInstrumentation` for `Alamofire.SessionDelegate`:

```
import Alamofire
import DatadogRUM

URLSessionInstrumentation.enableDurationBreakdown(with: .init(delegateClass: Alamofire.SessionDelegate.self))
```

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, see [Advanced Configuration > Automatically track network requests](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/advanced_configuration.md#automatically-track-network-requests).

## Apollo GraphQL{% #apollo-graphql %}

Starting from version `3.7.0`, the RUM iOS SDK automatically tracks [Apollo GraphQL](https://github.com/apollographql/apollo-ios) requests after you enable RUM with `urlSessionTracking` configuration.

1. Configure RUM monitoring by following the [Setup](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/setup.md) guide.
1. *(Optional)* For **detailed timing breakdown** (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable `URLSessionInstrumentation` for `Apollo.URLSessionClient`:

```
import Apollo
import DatadogRUM

URLSessionInstrumentation.enableDurationBreakdown(with: .init(delegateClass: Apollo.URLSessionClient.self))
```

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, see [Advanced Configuration > Automatically track network requests](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/advanced_configuration.md#automatically-track-network-requests).

For more advanced Apollo integration using the Datadog Apollo interceptor, see the [Datadog Apollo interceptor package](https://github.com/DataDog/dd-sdk-ios-apollo-interceptor) and [Apollo instrumentation](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/advanced_configuration.md#apollo-instrumentation).

## SDWebImage{% #sdwebimage %}

Starting from version `3.7.0`, the RUM iOS SDK automatically tracks [SDWebImage](https://github.com/SDWebImage/SDWebImage) requests after you enable RUM with `urlSessionTracking` configuration.

1. Configure RUM monitoring by following the [Setup](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/setup.md) guide.
1. *(Optional)* For **detailed timing breakdown** (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable `URLSessionInstrumentation` for `SDWebImageDownloader`:

```
import SDWebImage
import DatadogRUM

URLSessionInstrumentation.enableDurationBreakdown(with: .init(delegateClass: SDWebImageDownloader.self as! URLSessionDataDelegate.Type))
```

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, see [Advanced Configuration > Automatically track network requests](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/advanced_configuration.md#automatically-track-network-requests).

## OpenAPI Generator{% #openapi-generator %}

Starting from version `3.7.0`, the RUM iOS SDK automatically tracks [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) requests after you enable RUM with `urlSessionTracking` configuration.

For **detailed timing breakdown** (DNS resolution, SSL handshake, time to first byte, connection time, download duration), follow these steps:

1. Configure RUM monitoring by following the [Setup](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/setup.md) guide.
1. Create a dummy `URLSessionDataDelegate`.
1. Enable `URLSessionInstrumentation` for `EmptySessionDelegate`.
1. Configure `URLSession` with your dummy `URLSessionDataDelegate`.
1. Create an OpenAPI client with `.buffered` processing mode.

```
import DatadogRUM
import OpenAPIRuntime
import OpenAPIURLSession

// Dummy delegate
class EmptySessionDelegate: NSObject, URLSessionDataDelegate {}

// Create `URLSession` with your delegate
let delegate = EmptySessionDelegate()
let urlSession = URLSession(configuration: .default, delegate: delegate, delegateQueue: nil)

// Enable instrumentation for your delegate class
URLSessionInstrumentation.enableDurationBreakdown(with: .init(delegateClass: EmptySessionDelegate.self))

// Create transport with `.buffered` processing mode (required for proper instrumentation)
let transport = URLSessionTransport(configuration: .init(
    session: urlSession,
    httpBodyProcessingMode: .buffered
))

// Create the OpenAPI client
bufferedClient = Client(
    serverURL: try! Servers.Server1.url(),
    transport: transport
)
```

For additional information on sampling rate, distributed tracing, and adding custom attributes to tracked RUM resources, see [Advanced Configuration > Automatically track network requests](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/advanced_configuration.md#automatically-track-network-requests).
{% /section %}

{% section displayed-if="SDK is Flutter" %}
This section only applies to users who meet the following criteria: SDK is Flutter

This page lists integrated libraries you can use for Flutter applications.

## Routing and automatic view tracking{% #routing-and-automatic-view-tracking %}

If you are using Flutter Navigator v2.0, your setup for automatic view tracking differs depending on your routing middleware. This section explains how to integrate with the most popular routing packages.

### go_router{% #go-router %}

Because [go_router](https://pub.dev/packages?q=go_router) uses the same observer interface as Flutter Navigator v1, you can add `DatadogNavigationObserver` to other observers as a parameter to `GoRouter`.

```
final _router = GoRouter(
  routes: [
    // Your route information here
  ],
  observers: [
    DatadogNavigationObserver(datadogSdk: DatadogSdk.instance),
  ],
);
MaterialApp.router(
  routerConfig: _router,
  // Your remaining setup
);
```

If you are using ShellRoutes, you need to supply a separate observer to each `ShellRoute`, as shown below. See [this bug](https://github.com/flutter/flutter/issues/112196) for more information.

```
final _router = GoRouter(
  routes: [
    ShellRoute(build: shellBuilder),
    routes: [
      // Additional routes
    ],
    observers: [
      DatadogNavigationObserver(datadogSdk: DatadogSdk.instance),
    ],
  ],
  observers: [
    DatadogNavigationObserver(datadogSdk: DatadogSdk.instance),
  ],
);
MaterialApp.router(
  routerConfig: _router,
  // Your remaining setup
);
```

Additionally, if you are using `GoRoute`'s `pageBuilder` parameter over its `builder` parameter, make sure you are passing on the `state.pageKey` value and the `name` value to your `MaterialPage`.

```
GoRoute(
  name: 'My Home',
  path: '/path',
  pageBuilder: (context, state) {
    return MaterialPage(
      key: state.pageKey,       // Necessary for GoRouter to call Observers
      name: name,               // Needed for Datadog to get the right route name
      child: _buildContent(),
    );
  },
),
```

### AutoRoute{% #autoroute %}

[AutoRoute](https://pub.dev/packages/auto_route) can use a `DatadogNavigationObserver` provided as one of the `navigatorObservers` as part of its `config` method.

```
return MaterialApp.router(
  routerConfig: _router.config(
    navigatorObservers: () => [
      DatadogNavigationObserver(
        datadogSdk: DatadogSdk.instance,
      ),
    ],
  ),
  // Your remaining setup
);
```

However, if you are using AutoRoute's tab routing, you need to extend Datadog's default observer with AutoRoute's `AutoRouteObserver` interface.

```
class DatadogAutoRouteObserver extends DatadogNavigationObserver
    implements AutoRouterObserver {
  DatadogAutoRouteObserver({required super.datadogSdk});

  // only override to observer tab routes
  @override
  void didInitTabRoute(TabPageRoute route, TabPageRoute? previousRoute) {
    datadogSdk.rum?.startView(route.path, route.name);
  }

  @override
  void didChangeTabRoute(TabPageRoute route, TabPageRoute previousRoute) {
    datadogSdk.rum?.startView(route.path, route.name);
  }
}
```

This new object replaces the simpler `DatadogNavigationObserver`.

### Beamer{% #beamer %}

[Beamer](https://pub.dev/packages/beamer) can use the `DatadogNavigationObserver` as an argument to `BeamerDelegate`:

```
final routerDelegate = BeamerDelegate(
  locationBuilder: RoutesLocationBuilder(
    routes: {
      // Your route config
    },
  ),
  navigatorObservers: [
    DatadogNavigationObserver(DatadogSdk.instance),
  ]
);
```

## Web view tracking{% #web-view-tracking %}

Real User Monitoring allows you to monitor web views and eliminate blind spots in your hybrid mobile applications.

The Datadog Flutter SDK has packages for working with both [`webview_flutter`](https://pub.dev/packages/webview_flutter) and [`flutter_inappwebview`](https://pub.dev/packages/flutter_inappwebview). For more information, see the [Web View Tracking documentation page](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/web_view_tracking.md?tab=flutter).

## gRPC{% #grpc %}

Datadog provides [`datadog_grpc_interceptor`](https://pub.dev/packages/datadog_grpc_interceptor) for use with the [grpc Flutter package](https://pub.dev/packages/grpc). The gRPC interceptor automatically tracks gRPC requests as RUM Resources and enables distributed tracing with APM.

### Setup{% #setup %}

Add `datadog_grpc_interceptor` to your `pubspec.yaml` or by running `flutter pub add datadog_grpc_interceptor` from your terminal:

```
dependencies:
  # Other dependencies
  datadog_grpc_interceptor: ^1.1.0
```

To use this plugin, create an instance of `DatadogGrpcInterceptor`, then pass it to your generated gRPC client:

```
import 'package:datadog_grpc_interceptor/datadog_grpc_interceptor.dart'

// Initialize Datadog - be sure to set the [DatadogConfiguration.firstPartyHosts] member
// Enable Datadog Distributed Tracing
final config = DatadogConfiguration(
  // ...
  firstPartyHosts = ['localhost']
)

// Create the gRPC channel
final channel = ClientChannel(
  'localhost',
  port: 50051,
  options: ChannelOptions(
    // ...
  ),
);

// Create the gRPC interceptor with the supported channel
final datadogInterceptor = DatadogGrpcInterceptor(DatadogSdk.instance, channel);

// Create the gRPC client, passing in the Datadog interceptor
final stub = GreeterClient(channel, interceptors: [datadogInterceptor]);
```

## GraphQL (gql_link){% #graphql--gql-link %}

Datadog provides [`datadog_gql_link`](https://pub.dev/packages/datadog_gql_link) for use with most GraphQL Flutter libraries, including `graphql_flutter` and `ferry`. The link automatically tracks GraphQL requests as RUM resources, adds query names, mutation names, and variables as attributes of the Resource, and enables distributed tracing in APM.

### Setup{% #setup-2 %}

Add `datadog_gql_link` to your `pubspec.yaml` or by running `flutter pub add datadog_gql_link` from your terminal:

```
dependencies:
  # Other dependencies
  datadog_gql_link: ^1.0.0
```

When creating your GraphQL link, add the `DatadogGqlLink` above your terminating link. For example:

```
final graphQlUrl = "https://example.com/graphql";

final link = Link.from([
  DatadogGqlLink(DatadogSdk.instance, Uri.parse(graphQlUrl)),
  HttpLink(graphQlUrl),
]);
```

If you are tracking non-GraphQL network calls with `datadog_tracking_http_client`, you need to configure the tracking plugin to ignore requests to your GraphQL endpoint. Otherwise, GraphQL resources are reported twice, and APM traces may be broken. Ignore your GraphQL endpoint by using the `ignoreUrlPatterns` parameter added to `datadog_tracking_http_client` version 2.1.0.

```
final datadogConfig = DatadogConfiguration(
    // Your configuration
  )..enableHttpTracking(
      ignoreUrlPatterns: [
        RegExp('example.com/graphql'),
      ],
    );
```

## Dio{% #dio %}

{% alert level="info" %}
For most Dio setups, use Datadog Tracking Http Client instead of the specialized Dio interceptor. Only use the Dio interceptor if you're using a non-standard Dio `HttpClientAdapter` that cannot be tracked by Datadog Tracking Http Client.
{% /alert %}

Datadog provides [`datadog_dio`](https://pub.dev/packages/datadog_dio) for use with the [Dio Flutter package](https://pub.dev/packages/dio). The Dio interceptor automatically tracks requests from a given Dio client as RUM Resources and enables distributed tracing with APM.

### Setup{% #setup-3 %}

Add `datadog_dio` to your `pubspec.yaml` or by running `flutter pub add datadog_dio` from your terminal:

```
dependencies:
  # Other dependencies
  datadog_dio: ^1.0.0
```

To use this plugin, call `addDatadogInterceptor` at the end of your Dio initialization:

```
import 'package:datadog_dio/datadog_dio.dart'

// Initialize Datadog - be sure to set the [DatadogConfiguration.firstPartyHosts] member
// Enable Datadog Distributed Tracing
final config = DatadogConfiguration(
  // ...
  firstPartyHosts = ['localhost']
)

// Create our Dio client
final dio = Dio()
  // Dio configuration...
  ..addDatadogInterceptor(DatadogSdk.instance);
```

Calling `addDatadogInterceptor` adds the Datadog interceptor as the first interceptor in your list, so all network requests from Dio are sent to Datadog, since other interceptors may not forward information down the chain. Call `addDatadogInterceptor` after completing all other Dio configuration.

### Use with other Datadog network tracking{% #use-with-other-datadog-network-tracking %}

To track all network requests, including those made by `dart:io` and widgets like `NetworkImage`, use `datadog_tracking_http_client` to capture these requests. However, depending on your setup, the global override method used in `enableHttpTracking` may cause resources to be double reported (once by the global override and once by the Dio interceptor).

To avoid this, use the `ignoreUrlPatterns` parameter when calling `enableHttpTracking` to ignore requests made by your Dio client.
{% /section %}

{% section displayed-if="SDK is React Native" %}
This section only applies to users who meet the following criteria: SDK is React Native

This page lists integrated libraries you can use for React Native applications.

## React Navigation{% #react-navigation %}

### Setup{% #setup-4 %}

**Note**: This package is an integration for [`react-navigation`](https://reactnavigation.org/) library. Make sure you first install and set up the core `mobile-react-native` SDK.

To install with npm, run:

```
npm install @datadog/mobile-react-navigation
```

To install with Yarn, run:

```
yarn add @datadog/mobile-react-navigation
```

### Track view navigation{% #track-view-navigation %}

To track changes in navigation as RUM Views, set the `onReady` callback of your `NavigationContainer` component as follow. You can use the optional `ViewNamePredicate` parameter to replace the automatically detected View name with something more relevant to your use case.

Returning `null` in the `ViewNamePredicate` prevents the new RUM View from being created. The previous RUM View remains active.

```
import * as React from 'react';
import { DdRumReactNavigationTracking, ViewNamePredicate } from '@datadog/mobile-react-navigation';
import { Route } from "@react-navigation/native";

const viewNamePredicate: ViewNamePredicate = function customViewNamePredicate(route: Route<string, any | undefined>, trackedName: string) {
  return "My custom View Name"
}

function App() {
  const navigationRef = React.useRef(null);
  return (
    <View>
      <NavigationContainer ref={navigationRef} onReady={() => {
        DdRumReactNavigationTracking.startTrackingViews(navigationRef.current, viewNamePredicate)
      }}>
        // …
      </NavigationContainer>
    </View>
  );
}
```

**Note**: Only one `NavigationContainer` can be tracked at the time. If you need to track another container, stop tracking the previous one first, using `DdRumReactNavigationTracking.stopTrackingViews()`.

## React Native Navigation{% #react-native-navigation %}

**Note**: This package is an integration for `react-native-navigation` library. Make sure you first install and set up the core `mobile-react-native` SDK.

### Setup{% #setup-5 %}

To install with npm, run:

```
npm install @datadog/mobile-react-native-navigation
```

To install with Yarn, run:

```
yarn add @datadog/mobile-react-native-navigation
```

### Track view navigation{% #track-view-navigation-2 %}

To start tracking your navigation events, add the following lines before setting up your navigation. You can use the optional `ViewNamePredicate` callback to replace the automatically detected View name with something more relevant to your use case, based on the [`ComponentDidAppearEvent`](https://wix.github.io/react-native-navigation/api/events/#componentdidappear).

Returning null in the `ViewNamePredicate` prevents the new RUM View from being created. The previous RUM View remains active.

```
import { DdRumReactNativeNavigationTracking, ViewNamePredicate }  from '@datadog/mobile-react-native-navigation';
import { ComponentDidAppearEvent } from 'react-native-navigation';

const viewNamePredicate: ViewNamePredicate = function customViewNamePredicate(event: ComponentDidAppearEvent, trackedName: string) {
  return "My custom View Name"
}

DdRumReactNativeNavigationTracking.startTracking(viewNamePredicate);
```

## Apollo Client{% #apollo-client %}

**Note**: This package is an integration for the `@apollo/client` library. Make sure you first install and set up the core `mobile-react-native` SDK.

### Setup{% #setup-6 %}

To install with npm, run:

```
npm install @datadog/mobile-react-native-apollo-client
```

To install with Yarn, run:

```
yarn add @datadog/mobile-react-native-apollo-client
```

### Migrate to HttpLink{% #migrate-to-httplink %}

If you initialize your `ApolloClient` with the `uri` parameter, initialize it with a `HttpLink`:

```
import { ApolloClient, HttpLink } from '@apollo/client';

// before
const apolloClient = new ApolloClient({
    uri: 'https://my.api.com/graphql'
});

// after
const apolloClient = new ApolloClient({
    link: new HttpLink({ uri: 'https://my.api.com/graphql' })
});
```

### Use the Datadog Apollo Client Link to collect information{% #use-the-datadog-apollo-client-link-to-collect-information %}

Import `DatadogLink` from `@datadog/mobile-react-native-apollo-client` and use it in your `ApolloClient` initialization:

```
import { ApolloClient, from, HttpLink } from '@apollo/client';
import { DatadogLink } from '@datadog/mobile-react-native-apollo-client';

const apolloClient = new ApolloClient({
    link: from([
        new DatadogLink(),
        new HttpLink({ uri: 'https://my.api.com/graphql' }) // always in last position
    ])
});
```

For more information on Apollo Client Links, see the [official documentation](https://www.apollographql.com/docs/react/api/link/introduction/).

### Removing GraphQL information{% #removing-graphql-information %}

Use a `resourceEventMapper` in your Datadog RUM Configuration to remove sensitive data from GraphQL variables:

```
const datadogConfiguration = new DatadogProviderConfiguration(
    '<CLIENT_TOKEN>',
    '<ENVIRONMENT_NAME>',
    {
        rumConfiguration: {
            applicationId: '<APPLICATION_ID>', // RUM Application ID
            resourceEventMapper: (event) => {
              // Variables are stored in event.context['_dd.graphql.variables'] as a JSON string when present
              if (event.context['_dd.graphql.variables']) {
                  const variables = JSON.parse(event.context['_dd.graphql.variables']);
                  if (variables.password) {
                      variables.password = '***';
                  }
                  event.context['_dd.graphql.variables'] = JSON.stringify(variables);
              }

              return event;
          }
        },
        logsConfiguration: {}, // Enable Logs
        traceConfiguration: {} // Enable Traces
    }
);
```
{% /section %}

{% section displayed-if="SDK is Kotlin Multiplatform" %}
This section only applies to users who meet the following criteria: SDK is Kotlin Multiplatform

This page lists integrated libraries you can use for Kotlin Multiplatform applications.

## Ktor{% #ktor %}

If you use Ktor to make network requests in your application, you can integrate the Datadog Ktor plugin to collect RUM information about them:

1. [Install the Datadog Kotlin Multiplatform SDK and enable RUM](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/kotlin_multiplatform.md).
1. Add a common dependency to `dd-sdk-kotlin-multiplatform-ktor` if you're using Ktor 2.x, or `dd-sdk-kotlin-multiplatform-ktor3` for Ktor 3.x:

```
kotlin {
    // ...
    sourceSets {
        // ...
        commonMain.dependencies {
            // Use this line if you are using Ktor 2.x
            implementation("com.datadoghq:dd-sdk-kotlin-multiplatform-ktor:x.x.x")
            // Use this line if you are using Ktor 3.x
            // implementation("com.datadoghq:dd-sdk-kotlin-multiplatform-ktor3:x.x.x")
        }
    }
}
```
Add the provided `Datadog Ktor Plugin` to your Ktor `HttpClient`:
```
val ktorClient = HttpClient {
    install(
        datadogKtorPlugin(
            tracedHosts = mapOf(
                "example.com" to setOf(TracingHeaderType.DATADOG),
                "example.eu" to setOf(TracingHeaderType.DATADOG)
            ),
            traceSampleRate = 100f
        )
    )
}
```
{% /section %}
