> For the complete documentation index, see [llms.txt](https://docs.wepin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wepin.io/widget-integration/react-native-sdk/login-library/initialization.md).

# 초기화

Wepin React Native  Login Library 를 초기화하는 방법입니다.

## Import SDK

다음과 같이 import 문을 추가합니다.

```typescript
import WepinLogin from '@wepin/login-rn'
```

## WepinLogin Instance 생성 및 초기화 <a href="#creating-and-initializing-the-wepinlogin-instance" id="creating-and-initializing-the-wepinlogin-instance"></a>

먼저, `WepinLogin` 인스턴스를 생성하기 전에 위핀 워크스페이스에서 Android/iOS 관련 앱 정보를 등록해야 합니다.

{% content-ref url="/pages/cfg4nwJBI8VfiJpH4EW8" %}
[앱 등록 및 키 발급](/wepin/workspace/app-registration-and-key-issuance.md)
{% endcontent-ref %}

등록한 앱 정보를 바탕으로 `WepinLogin` 인스턴스를 생성하고, `init()` 메소드를 호출하여 초기화 해야 합니다.

```typescript
const wepinLogin = new WepinLogin({
  appId: 'wepinAppId',
  appKey: 'wepinAppKey',
});

await wepinLogin.init()
```

## isInitialized

<mark style="color:blue;">`isInitialized`</mark>메서드를 이용해서 WepinLogin 인스턴스가 정상적으로 초기화 되었는지 확인할 수 있습니다. &#x20;

반환값은 아래와 같습니다.&#x20;

* **\<boolean>**\
  초기화가 성공적으로 완료된 경우 `true`, 실패한 경우 `false`를 반환합니다.

```typescript
if(wepinLogin.isInitialized()) {
    // Success to initialize WepinLogin
}
```
