# Initialization

Here is how to initialize the Wepin widget Unity SDK.

## Create Wepin Instance

Add the Wepin and Types namespaces.

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

Create a Wepin instance in the <mark style="color:blue;">`start()`</mark> function of the project.

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

## Initialize

Use the App ID and App Key assigned after app registration to initialize the instance.

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

The parameters for initialization are as follows.

* **`appId`**: *String*\
  App ID assigned during registration
* **`appKey`**: *String*\
  App Key assigned during registration
* **`attributes`**: *WepinSDK.Types.Attributes*\
  Properties of the Wepin Widget
  * **`defaultLanguage`**: *String*\
    The language to be displayed on the widget. The default value is <mark style="color:blue;">`ko`</mark>. The currently supported languages are <mark style="color:blue;">`en`</mark> and <mark style="color:blue;">`ko`</mark>.
  * **`defaultCurrency`:** *String*\
    The currency to be displayed on the widget. The default value is <mark style="color:blue;">`KRW`</mark>. The currently supported currencies are <mark style="color:blue;">`USD`</mark> and <mark style="color:blue;">`KRW`</mark>.<br>

## `isInitialized`

You can use the <mark style="color:blue;">`isInitialized`</mark> method to check if the Wepin instance has been initialized successfully.

The returned value is as follows.

* *boolean*\
  init result; <mark style="color:orange;">`true`</mark> if Wepin SDK is already initialized, otherwise <mark style="color:orange;">`false`</mark>.

```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/en/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.
