# Client

## Methods <a href="#methods" id="methods"></a>

| login(username, password) |
| ------------------------- |
| Connect to twitch         |

* **Parameters**
* * username - accounts username (string)
* * password - accounts auth password (string)

{% hint style="info" %}
password parameter is not your account. To get the correct Auth password, [`follow this link`](https://twitchapps.com/tmi/)
{% endhint %}

## Properties

| Name           | Type                                                                                | Description                                                 |
| -------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| options        | [ClientOptions](https://test845a.gitbook.io/twitch-tvjs/typedefs/clientoptions)     | client options                                              |
| reconnect      | boolean                                                                             | Whether or not to reconnect the client if gets disconnected |
| channels       | <p></p><p><a href="storage">Storage</a>\<string, <a href="channel">Channel</a>></p> |                                                             |
| user           | [ClientUser](https://test845a.gitbook.io/twitch-tvjs/typedefs/clientuser)           | User that the client is logged in as                        |
| ready          | boolean                                                                             | whether or not the client is ready                          |
| currentLatency | number                                                                              | Client ping rate                                            |
| latency        | Date                                                                                | Respons latency                                             |
| readyAt        | number                                                                              | The time the client was ready at                            |

## Events

| Name          | **Parameters**                                                               | Description |
| ------------- | ---------------------------------------------------------------------------- | ----------- |
| ready         | `none`                                                                       |             |
| connecting    | `none`                                                                       |             |
| disconnected  | `none`                                                                       |             |
| chat          | message - [Message](https://test845a.gitbook.io/twitch-tvjs/classes/message) |             |
| cheer         | message - [Message](https://test845a.gitbook.io/twitch-tvjs/classes/message) |             |
| joinRoom      | room - [Channel](https://test845a.gitbook.io/twitch-tvjs/classes/channel)    |             |
| leaveRoom     | room - [Channel](https://test845a.gitbook.io/twitch-tvjs/classes/channel)    |             |
| viewerBan     | viewer - [Viewer](https://test845a.gitbook.io/twitch-tvjs/classes/viewer)    |             |
| viewerUnban   | `none`                                                                       |             |
| viewerTimeout | viewer - [Viewer](https://test845a.gitbook.io/twitch-tvjs/classes/viewer)    |             |
| warn          | info - any                                                                   |             |
| error         | error - any                                                                  |             |
| raw\_message  | message - Object                                                             |             |
| raw           | info - string                                                                |             |
