---
title: React Native SDK configuration
description: Configure your workspace key in AndroidManifest.xml file.
source_url:
  html: 'https://developers.survicate.com/mobile-sdk/react-native/configuration/'
  md: 'https://developers.survicate.com/mobile-sdk/react-native/configuration.md'
---
# React Native 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)

## Configuring Survicate Bindings for Expo
Add [config plugin](https://docs.expo.dev/config-plugins/introduction/) to `plugins` array of your `app.json` or `app.config.js`
```json
{
  "expo": {
    "plugins": [
      [
        "@survicate/react-native-survicate",
        {
          "workspaceKey": "YOUR_WORKSPACE_KEY"
        }
      ]
    ]
  }
}
```
_Note: Please note that every time you change the props or plugins, you'll need to [rebuild](https://docs.expo.dev/workflow/customizing/) the native app.

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

Important:
* Regardless of the method used to set the Workspace Key, the config plugin entry with the `workspaceKey` property must be added to the `plugins` array in your `app.json` or `app.config.js`. If you use `setWorkspaceKey()` to provide the key at runtime, you still need to include the plugin entry with an empty `workspaceKey` value.
* Using `setWorkspaceKey()` method overrides the Workspace Key defined in the configuration.
* `setWorkspaceKey()` method must be used before `initializeSdk()` method is called.

```javascript
Survicate.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 `src/App.js` file).

```javascript
import Survicate from '@survicate/react-native-survicate';

// ...
// useEffect(() => {
     Survicate.initializeSdk();
// }, []);
// ...
```
