---
title: iOS and tvOS Libraries for RUM
description: >-
  Integrate popular iOS libraries like URLSession, Alamofire, Apollo GraphQL and
  image loaders with RUM for automatic monitoring and tracking.
breadcrumbs: >-
  Docs > RUM & Session Replay > Application Monitoring > iOS and tvOS Monitoring
  > iOS and tvOS Libraries for RUM
---

# iOS and tvOS Libraries for RUM

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) guide.
1. *(Optional)* For **detailed timing breakdown** (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable `URLSessionInstrumentation` for `Alamofire.SessionDelegate`:

```swift
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, refer to [Advanced Configuration > Automatically track network requests](https://docs.datadoghq.com/real_user_monitoring/application_monitoring/ios/advanced_configuration/#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) guide.
1. *(Optional)* For **detailed timing breakdown** (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable `URLSessionInstrumentation` for `Apollo.URLSessionClient`:

```swift
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/#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/#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) guide.
1. *(Optional)* For **detailed timing breakdown** (DNS resolution, SSL handshake, time to first byte, connection time, download duration), enable `URLSessionInstrumentation` for `SDWebImageDownloader`:

```swift
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/#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) 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.

```swift
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/#automatically-track-network-requests).
