> For the complete documentation index, see [llms.txt](https://pub-star.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pub-star.gitbook.io/docs/1.5.1/unity-sdk/initialize.md).

# Initialize

### Initialize(callback)

Initialization PubStar SDK. Initialization must be called once before loading or showing ads.

### Event

`Initialize`

| Callback  | Function                                                 |
| --------- | -------------------------------------------------------- |
| `onDone`  | call when PubStar SDK initializes successfully           |
| `onError` | call when load ad failed. return object type `ErrorCode` |

### Example

```c#
using PubStar.Io;

PubStar.Initialize(
    onDone: () =>
    {
        // callback when init done (ready to call load and show ad)
    },
    onError: code =>
    {
        // callback when init error
    }
);
```
