---
title: "Flutter SDK setup"
description: "Install and initialize Gleap in your application with the Gleap Flutter SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/531-flutter-sdk-setup
collection: "Flutter"
updated: 2026-11-01
language: en
---

# Flutter SDK setup

Install and initialize Gleap in your application with the Gleap Flutter SDK. Follow the integration code examples.

The Gleap SDK for Flutter is the easiest way to integrate Gleap into your apps. Communicate with your users directly and build better software by discovering their everyday pain points. Gleap is your all-in-one customer feedback tool for apps and websites.

For the SDK to work, you need an API key, which you can get for free at [app.gleap.ai](https://app.gleap.ai).

#### Supported platforms

<table style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>✅ iOS</p></th><th colspan="1" rowspan="1"><p>✅ Android</p></th><th colspan="1" rowspan="1"><p>✅ Web</p></th></tr></tbody></table>

## 🏗 Installation

Open a terminal window and navigate to the root folder of your iOS project.

### Install the Gleap SDK

#### Run this command to add Gleap to your dependencies:

```javascript
 flutter pub add gleap_sdk
```

#### Requirements

`gleap_sdk` 19 needs Dart 3.3 / Flutter 3.19 or newer, iOS 15 or newer and Android `minSdkVersion` 21 or higher.

### iOS installation

`gleap_sdk` needs an iOS deployment target of **15.0** or higher. On iOS it is a Swift package (`ios/gleap_sdk/Package.swift`) that pulls the native [Gleap iOS SDK](https://github.com/GleapSDK/Gleap-iOS-SDK) from GitHub; it still ships a podspec for apps that use CocoaPods. Flutter picks one of the two for you.

**Swift Package Manager (recommended)**

Needs Flutter 3.41 or newer (the plugin's package depends on the `FlutterFramework` package that Flutter generates since 3.41) and Xcode 15 or newer. From Flutter 3.44 Swift Package Manager is on by default: run `flutter run` or `flutter build ios` and Flutter adds the integration to your Xcode project. On Flutter 3.41 to 3.43 turn it on first:

```bash
flutter config --enable-swift-package-manager
```

Or turn it on for the project in your app's `pubspec.yaml`:

```yaml
flutter:
  config:
    enable-swift-package-manager: true
```

Set the Runner target's Minimum Deployments to 15.0 in Xcode, otherwise Xcode reports that `gleap-sdk` requires iOS 15.0. See [Swift Package Manager for app developers](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers) for details.

> **Warning:** Apps that turned Swift Package Manager on with Flutter 3.24 to 3.40 must turn it off again (`flutter config --no-enable-swift-package-manager`) or upgrade Flutter to 3.41+.

**CocoaPods**

Used on Flutter older than 3.41 and whenever Swift Package Manager is turned off. Set `platform :ios, '15.0'` in `ios/Podfile` and run `flutter run` / `flutter build ios` (or `pod install` in `ios/`). When upgrading from an older `gleap_sdk`, run this once in `ios/`:

```bash
pod update Gleap gleap_sdk
```

> **Warning:** CocoaPods trunk becomes read-only on December 2, 2026, so Gleap iOS SDK versions released after that date are not on trunk. For those, `pod install` fails with `None of your spec sources contain Gleap (= X.Y.Z)`. Add the SDK from GitHub to the Runner target in your Podfile, with the version the plugin requires (`s.dependency 'Gleap', 'X.Y.Z'` in the plugin's `ios/gleap_sdk.podspec`):
> `target 'Runner' do`
> `flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))`
> `pod 'Gleap', :git => 'https://github.com/GleapSDK/Gleap-iOS-SDK.git', :tag => 'X.Y.Z'`
> `end`
> Only add this line with CocoaPods: if `gleap_sdk` comes through Swift Package Manager, a `pod 'Gleap'` in the Podfile links the Gleap iOS SDK a second time.

### Android installation

Android should be already good to go. If theres a version conflict pls add the following to your android manifest:

```javascript
<manifest ... xmlns:tools="http://schemas.android.com/tools">
 <uses-sdk  android:minSdkVersion="21"
        tools:overrideLibrary="io.gleap.gleap_sdk"/>
 <application .... tools:overrideLibrary="io.gleap.gleap_sdk">
 ...
```

**Important**: Always have a look at your minSdkVersion on android and your minimum target version on iOS to keep them on the same minimum version gleap needs.

> **Info:** Do not set `android:hardwareAccelerated="false"` at the application level in your `AndroidManifest.xml`. This can cause issues with the Gleap SDK on Android. If you need to disable hardware acceleration, consider applying it only to specific activities instead.

### Web installation

Navigate to your web project folder and insert the following snippet as first element within the head tag of your index.html

```js
<script>
!function(){if(!(window.Gleap=window.Gleap||[]).invoked){window.GleapActions=[];var e=new Proxy({invoked:!0},{get:function(e,n){return"invoked"===n?e.invoked:function(){var e=Array.prototype.slice.call(arguments);window.GleapActions.push({e:n,a:e})}},set:function(e,n,t){return e[n]=t,!0}});window.Gleap=e;var n=document.getElementsByTagName("head")[0],t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://sdk.gleap.io/latest/index.js",n.appendChild(t)}}();
</script>
```

Please note that you must need to run `flutter clean` and `flutter pub get` after adding the Gleap script to your index.html file.

### Configure the SDK

The last step is to initialize & configure the Gleap SDK by adding the following code. If you want to add the Gleap SDK in your main.dart make sure to call `WidgetsFlutterBinding.ensureInitialized();` before you initialize the Gleap SDK.

```dart
Gleap.initialize(token: 'YOUR_API_KEY');
```

Congratulations 🎉 You are all set 👋

## 🌍 Data region

Gleap stores and processes your data in the region you selected at signup: EU (default) or US. If your project lives in the US region, select the region **before** initializing the SDK (requires SDK v18.0.0 or newer). EU projects don't need this call.

```dart
await Gleap.setRegion(region: 'us');
Gleap.initialize(token: 'YOUR_API_KEY');
```

See [Data regions](https://gleap-developer-docs.gleap.help/en/articles/711-data-regions) for all hosts and details.

## Required permissions (Android)

In order to use the image picker for attachments, add the following permissions to your `AndroidManifest.xml`.

```javascript
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
```

The following permissions are needed to enable audio recordings.

```javascript
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.audio.pro" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
```

## Required permissions (iOS)

In order to use the image picker for attachments, add the following permissions to your `Info.plist`.

```javascript
<key>NSPhotoLibraryUsageDescription</key> <string>We need access to your photo library to allow you to select an image.</string> 

<key>NSCameraUsageDescription</key> <string>We need access to your camera to take photos.</string> 
```

The following permissions are needed to enable audio recordings.

```javascript
<key>NSMicrophoneUsageDescription</key> <string>We need access to your microphone to record audio with videos.</string>
```

## 🤝 Need help?

We are here to help! [hello@gleap.ai](mailto:hello@gleap.ai)

## Related

- [Flutter SDK: User identity](https://docs.gleap.ai/en/articles/532-flutter-sdk-user-identity.md)
- [Flutter SDK: Track events](https://docs.gleap.ai/en/articles/533-flutter-sdk-track-events.md)
- [Flutter SDK: Track pages](https://docs.gleap.ai/en/articles/534-flutter-sdk-track-pages.md)
- [Flutter SDK: Frontend tools](https://docs.gleap.ai/en/articles/535-flutter-sdk-frontend-tools.md)
- [Flutter SDK: Forms](https://docs.gleap.ai/en/articles/536-flutter-sdk-forms.md)
