# React Native SDK

This guide demonstrates how to easily implement our SDK for chat.

## Installation

The React Native SDK is available using [npm](https://www.npmjs.com/).

To install it, run the following command in a terminal or command prompt:


```shell
npm install sinch-chat-react-native-sdk
```

## Configuring the application

To set up your application to start sending and receiving messages, you need to perform the following steps:

1. [Initialize](#initialize-the-sdk) the SDK as soon as the application starts.
2. [Set the identity](#set-identity) of the user.
3. [Enable](#enabling-and-controlling-the-chat) the chat functionality.


## Initialize the SDK

To initialize the SDK, use the `initialize` method:


```javascript
async initialize(): Promise<void>
```

## Set Identity

We need to authorize the user next. To do that, call this method as early as possible to authorize the user:


```javascript
async setIdentity(options: IdentityOptions): Promise<void>
```


```javascript
interface IdentityOptions {
  region: string;
  clientID: string;
  projectID: string;
  configID: string;
  userID?: string;
  secret?: string;
}
```

After correct authorization, the token will be saved in local storage.

### Set the configuration parameters

To connect your Sinch Chat client to your Sinch account, you need to set the following parameters:

| Parameter | Description |
|  --- | --- |
| projectId | Get your project ID from your Sinch Dashboard. |
| clientId | Get your client ID from your Sinch Dashboard. |
| region | Use either `EU` for Europe or `US` for the United States. |


## Enabling and controlling the chat

You can enable and control the chat widget using the following method:

### open

To display the widget.


```javascript
async startChat(): Promise<void>
```

## Next steps

After your client is set up, now you can configure the [Sinch Chat channel](/docs/conversation/channel-support/chat) in the Conversation API and start sending and receiving messages.