---
title: "Native Access to the SDK"
description: "How to directly access the SDK without the shared module."
url: https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/native-access-sdk/
---

# Native Access to the SDK | Sentry for Kotlin Multiplatform

If you need to access the SDK directly in your native platform without the shared module, you first need to change the dependency configuration from `implementation(...)` to `api(...)`:

`shared/build.gradle.kts`

```kotlin
val commonMain by getting {
  dependencies {
    api("io.sentry:sentry-kotlin-multiplatform:0.25.0")
  }
}
```

## [Export the Framework](https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/native-access-sdk.md#export-the-framework)

If you have Apple targets, you also need to export the framework.

### [Cocoapods](https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/native-access-sdk.md#cocoapods)

`shared/build.gradle.kts`

```kotlin
cocoapods {
  summary = "Some description for the Shared Module"
  homepage = "Link to the Shared Module homepage"
  ios.deploymentTarget = "14.1"
  podfile = project.file("../iosApp/Podfile")
  // Make sure you use the proper version according to our Cocoa SDK Version Compatibility Table.
  pod("Sentry") {
    version = "~> 8.25"
    linkOnly = true
    extraOpts += listOf("-compiler-option", "-fmodules")
  }
  framework {
    baseName = "shared"
    export("io.sentry:sentry-kotlin-multiplatform:0.25.0")
  }
}
```

### [Swift Package Manager](https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/native-access-sdk.md#swift-package-manager)

`shared/build.gradle.kts`

```kotlin
listOf(
  iosX64(),
  iosArm64(),
  iosSimulatorArm64()
).forEach {
  it.binaries.framework {
      baseName = "shared"
      isStatic = true
      export("io.sentry:sentry-kotlin-multiplatform:0.25.0")
  }
}
```

## [Usage](https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/native-access-sdk.md#usage)

Now you can access the SDK directly in your native platform:

### [Android](https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/native-access-sdk.md#android)

```kotlin
import io.sentry.kotlin.multiplatform.Sentry

Sentry.captureMessage("My message")
```

### [iOS](https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/native-access-sdk.md#ios)

```swift
import shared

Sentry.shared.captureMessage(message: "My message")
```
