# 초기화하기

Wepin Compose Multiplatform Login Library 를 설치한 후 다음 단계는 SDK를 초기화하는 것입니다. SDK 초기화는 `WepinLogin` 인스턴스를 생성하고, `init()` 함수를 사용하여 진행할 수 있습니다.

## Import SDK

Wepin Compose Multiplatform Login Library 를 사용하기 위해 SDK를 가져와야 합니다. 다음과 같이 import 문을 추가합니다.

```kotlin
import com.wepin.cm.loginlib.WepinLogin
import com.wepin.cm.loginlib.types.*
```

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

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

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

등록한 앱 정보를 바탕으로 `WepinLogin` 인스턴스를 생성합니다.&#x20;

```kotlin
private val wepinLogin: WepinLogin = WepinLogin(
    WepinLoginOptions(
        context = context,    //Android: Context, ios: UIViewController
        appId = appId,
        appKey = appKey
    )
)
wepinLogin.init()
```

## isInitialized

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

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

* **\<Boolean>**\
  초기화가 정상적으로 잘 된 경우 true , 실패한 경우 false 를 반환합니다.

```dart
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/compose-multiplatform-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.
