# Initialization

## **Import SDK**

To use the Wepin React Native Provider SDK, you first need to import the SDK. Add the following import statements:

```javascript
import WepinProvider from '@wepin/provider-rn';
```

## Creating **the WepinProviderSDK Instance**

Before creating an instance of `WepinProvider`, you must register your app's Android/iOS information in the Wepin Workspace.

{% content-ref url="/pages/dQiDmklSBMcztyymHWPu" %}
[App Registration and Key Issuance](/en/wepin/workspace/app-registration-and-key-issuance.md)
{% endcontent-ref %}

Using the registered app information, create an instance of `WepinProvider`. Create the `WepinProvider` instance as follows:

```javascript
const wepinProvider = new WepinProvider({
  appId: 'wepinAppId',
  appKey: 'wepinAppKey',
});
```

## **SDK Initialization (init)**

When initializing the Wepin React Native Provider SDK, you can define the required widget properties.

```javascript
await wepinProvider.init();
```

#### **Parameters**

* **attributes** <`IWepinSDKAttributes`> **optional**
  * defaultLanguage: - `defaultLanguage`: The language to be displayed on the widget (default: `'en'`) Currently, only `ko`, `en`, and `ja` are supported.
  * **defaultCurrency**: The currency to be displayed on the widget (default: `'USD'`) Currently, only `'KRW'`,`'USD'` and `'JPY'` are supported.

#### **Return value**

* **Promise**<`boolean`>

#### **Example**

```javascript
await wepinPin.init({
  defaultLanguage: 'ko',
  defaultCurrency: 'KRW',
});
```

## **Checking Initialization Status (isInitialized)**

You can check whether the Wepin Provider SDK has been successfully initialized.

```javascript
wepinProvider.isInitialized();
```

#### **Parameters**

* **None**

#### **Return Value**

* **\<boolean>**
  * Returns `true` if the initialization was successful, and `false` if it failed.

## **Changing Language**

Change the language and currency of the widget.

```javascript
await wepinProvider.changeLanguage({ language, currency });
```

#### **Parameters**

* **\<object>**
  * **language** `<String>`\
    `-` The language to be displayed on the widget. Currently, only `'ko'`, `'en'` and `'ja'` are supported.
  * **currency** `<String>`\
    **optional -** The currency to be displayed on the widget. Currently, only `'KRW'`, `'USD'` and `'JPY'` are supported.


---

# 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/provider/initialization.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.
