# 초기화

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
}
```


---

# 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/widget-integration/react-native-sdk/login-library/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.
