---
title: "Use AWS SDK"
section: "frontend/analytics"
platforms: ["android", "swift"]
gen: 2
last-updated: "2026-03-25T17:40:00.000Z"
url: "https://docs.amplify.aws/react/frontend/analytics/sdk/"
---

<!-- Platform: swift -->
For advanced use cases where Amplify does not provide the functionality, you can retrieve an escape hatch to access the underlying Amazon Pinpoint client.

Add the following import:

```swift
import AWSPinpointAnalyticsPlugin
```

Then retrieve the escape hatch with this code:

```swift
do {
    // Retrieve the reference to AWSPinpointAnalyticsPlugin
    let plugin = try Amplify.Analytics.getPlugin(for: "awsPinpointAnalyticsPlugin")
    guard let analyticsPlugin = plugin as? AWSPinpointAnalyticsPlugin else {
        return
    }

    // Retrieve the reference to PinpointClientProtocol
    let pinpointClient = analyticsPlugin.getEscapeHatch()

    // Make requests using pinpointClient...
    // ...
} catch {
    print("Get escape hatch failed with error - \(error)")
}
```
<!-- /Platform -->

<!-- Platform: android -->
For advanced use cases where Amplify does not provide the functionality, you can retrieve an escape hatch to access the underlying Amazon Pinpoint client.

#### [Java]

<Callout>

Learn more about consuming Kotlin clients from Java using either a blocking interface or an equivalent async interface based on futures [here](https://github.com/awslabs/smithy-kotlin/blob/main/docs/design/kotlin-smithy-sdk.md#java-interop).

</Callout>

```java
AWSPinpointAnalyticsPlugin plugin = (AWSPinpointAnalyticsPlugin)
    Amplify.Analytics.getPlugin("awsPinpointAnalyticsPlugin");
PinpointClient pinpointClient = plugin.getEscapeHatch();
```

#### [Kotlin]

```kotlin
val plugin = Amplify.Analytics.getPlugin("awsPinpointAnalyticsPlugin")
val pinpointClient = (plugin as AWSPinpointAnalyticsPlugin).escapeHatch
```

#### [RxJava]

```java
AWSPinpointAnalyticsPlugin plugin = (AWSPinpointAnalyticsPlugin)
    RxAmplify.Analytics.getPlugin("awsPinpointAnalyticsPlugin");
PinpointClient pinpointClient = plugin.getEscapeHatch();
```

<!-- /Platform -->
