# Initialization

## Initialization <a href="#undefined" id="undefined"></a>

Before using Game Chat, it must be initialized. \
Add the project ID you checked in the dashboard. To initialize Game Chat, follow these steps:

1. Access the dashboard and check the project ID in the settings menu.
2. Use the following code to initialize instances.

* Import the NBaseSDK module.

```csharp
using NBaseSDK;
```

* Create an NBaseSDK Chat instance.

```csharp
NBaseSDK.Chat nc = NBaseSDK.Chat.GetInstance();
```

* Initialize NChat. \
  Enter the settings for projectId, region, and language.

```csharp
nc.initialize([PROJECT_ID], [REGION], [LANGUAGE]);
```

<table><thead><tr><th width="158">ID</th><th width="98">Type</th><th width="365">Description</th><th>Required</th></tr></thead><tbody><tr><td>PROJECT_ID</td><td>string</td><td>ID (Game Chat dashboard Project ID)</td><td>O</td></tr><tr><td>REGION</td><td>string</td><td>Region (use "kr" if not using a specific one)</td><td>O</td></tr><tr><td>LANGUAGE</td><td>string</td><td>Language code ("en", "ko", etc.)</td><td>O</td></tr></tbody></table>

## Error handling <a href="#undefined" id="undefined"></a>

* Basic error handling is to add the code inside the try... catch as follows:

```csharp
try
{
    // Write the code that may cause an error here.
    ...
}
catch (InvalidOperationException e)
{
    // Write the handling for specific error types here.
    Console.WriteLine("InvalidOperationException: {0}", e.Message);
}
catch(Exception e)
{
    // Write the general error handling here.
    Console.WriteLine("Error: {0}", e.Message);
}

```


---

# 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.gamechat.me/basics/game-chat-v3/game-chat-english/start-using-v3/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.
