# 초기화하기

Wepin widget unity SDK를 초기화하는 방법입니다.

## 위핀 instance 생성 <a href="#create-wepin-instance" id="create-wepin-instance"></a>

Wepin과 Types의 네임 스페이스를 추가합니다.&#x20;

```csharp
using WepinSDK.Wepin;
using WepinSDK.Types;
```

프로젝트의  <mark style="color:blue;">`start()`</mark>에서 위핀 instance를 생성합니다.&#x20;

```csharp
Wepin _wepin = Wepin.Instance;
```

## 초기화하기 <a href="#initialize" id="initialize"></a>

앱 등록 후 할당 받은 App ID와 App Key로 위핀 위젯을 초기화 합니다.

```csharp
_wepin.Initialize("app_id_eg12sf3491azgs520", "ak_test_ghq1D5s1sfG234sbnhdsw24mnovk313", new Attributes()
{
    defaultLanguage = "ko",
    defaultCurrency = "krw"
});
```

초기화에 사용되는 파라미터는 아래와 같습니다.

* **appId**: *String*\
  앱 등록 시 할당 받은 ID
* **appKey**: *String*\
  앱 등록 시 할당 받은 키 값
* **attributes**: *WepinSDK.Types.Attributes*\
  위핀 위젯의 속성 값
  * **defaultLanguage**: *String*\
    위젯 기본 언어 설정, 기본 값은 `ko`입니다. 현재 지원하는 언어는 `en`, `ko` 2가지 입니다.
  * **defaultCurrency:** *String*\
    위젯 기본 통화 설정, 기본 값은 `KRW`입니다. 현재 지원하는 통화는 `USD`, `KRW` 2가지 입니다.<br>

## isInitialized

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

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

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

```csharp
if(_wepin.isInitialized()) {
    // Success to initialize wepin
}
```


---

# 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/deprecated/unity-sdk/init.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.
