> For the complete documentation index, see [llms.txt](https://bmsvieira.gitbook.io/nova-irc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bmsvieira.gitbook.io/nova-irc/methods/setcredentials.md).

# setCredentials

The `setCredentials` method sets the bot's nickname, real name, and optional password for connecting to an IRC server.

#### Syntax

```javascript
bot.setCredentials(nickname, realname, password);
```

#### Parameters

* **`nickname`** *(string, required)* – The nickname your bot will use on the IRC network.
* **`realname`** *(string, required)* – The real name or description of the bot.
* **`password`** *(string, optional, default: `null`)* – The optional password for authentication, if required by the server.

#### Example Usage

```javascript
bot.setCredentials('YOUR-NICKNAME', 'BOT-DESCRIPTION');
```

This sets the bot's nickname to `YOUR-NICKNAME` and the real name to `BOT-DESCRIPTION`, without a password.

If authentication is required (your account is registered):

```javascript
bot.setCredentials('YOUR-NICKNAME', 'BOT-DESCRIPTION', 'PASSWORD');
```

#### Notes

* The nickname should be unique on the IRC server.
* If a password is required, ensure it is stored securely.
* Calling `setCredentials` before connecting ensures the correct identity is used.
