---
title: Flutter SDK configuration
description: Configure your workspace key in AndroidManifest.xml file.
source_url:
  html: 'https://developers.survicate.com/mobile-sdk/flutter/configuration/'
  md: 'https://developers.survicate.com/mobile-sdk/flutter/configuration.md'
---
# Flutter SDK configuration

## Configuration for Android
Configure your *workspace key* in `AndroidManifest.xml` file.

```xml title="AndroidManifest.xml"
<application
    android:name=".MyApp"
>
    <!-- ... -->
    <meta-data android:name="com.survicate.surveys.workspaceKey" android:value="YOUR_WORKSPACE_KEY"/>
</application>
```

## Configuration for iOS
Add workspace key to your `Info.plist` file.
   - Create `Survicate` *Dictionary*.
   - Define `WorkspaceKey` *String* in `Survicate` *Dictionary*.
   Your `Info.plist` file should look like this:
   ![Info.plist example](/ios-infoplist.png)

As an alternative to the main way of specifying the Workspace Key, you can also use the `setWorkspaceKey()` method.

Important:
* Using `setWorkspaceKey()` method overrides the Workspace Key defined in the configuration.
* `setWorkspaceKey()` method must be used before `initializeSdk()` method is called.

```dart
SurvicateSdk.setWorkspaceKey('your_workspace_key');
```

## Initialization

Initialize the SDK in your application using `initializeSdk()` method. Call this method only once, in the main component (e.g `lib/main.dart` file).

```dart
import 'package:survicate_sdk/survicate_sdk.dart';

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    SurvicateSdk.initializeSdk();
  }
}
```
