# Installation

## **Requirements**

* **React Native:** version 0.71.8 or higher
* **Android:** API version <mark style="color:blue;">**24**</mark> or higher
* **iOS:** Version <mark style="color:blue;">**13.0**</mark> or higher

{% hint style="info" %}
This package is only available for **Android** and **iOS** environments. It is not supported on **Web**, **macOS**, **Windows**, or **Linux** environments.
{% endhint %}

{% hint style="warning" %}
New Architecture is not supported yet
{% endhint %}

## Installation

It can be installed as an npm package.

{% tabs %}
{% tab title="npm" %}

```bash
npm install @wepin/sdk-rn
```

{% endtab %}

{% tab title="yarn" %}

```bash
npm install @wepin/sdk-rn
```

{% endtab %}
{% endtabs %}

### peerDependencies

{% tabs %}
{% tab title="npm" %}

```bash
npm install react-native-device-info

# for ios
cd ios
pod install
```

{% endtab %}

{% tab title="yarn" %}

```bash
yarn add react-native-device-info

# for ios
cd ios
pod install
```

{% endtab %}
{% endtabs %}

### Configuration <a href="#configuration" id="configuration"></a>

To enable OAuth login functionality, you need to configure the Deep Link Scheme.

Deep Link scheme format : `wepin. + Your Wepin App ID`

#### Android

When a custom scheme is used, Wepin Widget Library can be easily configured to capture all redirects using this custom scheme through a manifest placeholder in the file `build.gradle(app)`:

```
// For Deep Link => RedirectScheme Format : wepin. + Wepin App ID
android.defaultConfig.manifestPlaceholders = [
  'appAuthRedirectScheme': 'wepin.{{YOUR_WEPIN_APPID}}'
]
```

#### iOS

You must add the app's URL scheme to the Info.plist file. This is necessary for redirection back to the app after the authentication process.

The value of the URL scheme should be `'wepin.' + your Wepin app id`.

```
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>unique name</string>
        <array>
            <string>wepin + your Wepin app id</string>
        </array>
    </dict>
</array>
```

#### iOS Podfile Configuration

Build errors may occur when using Xcode 26.0.1 or later versions.&#x20;

> error Unable to find module dependency: 'bcrypt' (in target 'WepinLogin' from project 'Pods')&#x20;

If you encounter the above error, please add the following code to your Podfile.

```
post_install do |installer|
  installer.pods_project.targets.each do |target| 
    target.build_configurations.each do |config| 
      config.build_settings['SWIFT_ENABLE_EXPLICIT_MODULES'] = 'NO' 
    end 
  end 
end
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wepin.io/en/widget-integration/react-native-sdk/widget/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
