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

# main

{% hint style="info" %}
Welcome to oberknecht-client - a JavaScript based IRC Client for Twitch
{% endhint %}

## Owned Packages used in this client:

{% hint style="success" %}
<https://github.com/jubewe/oberknecht-utils>
{% endhint %}

{% hint style="success" %}
<https://github.com/jubewe/oberknecht-api>
{% endhint %}

## Usage

{% hint style="info" %}
You'll need to have NodeJS (/npm) installed to use this package.
{% endhint %}

## Full Sample at: <https://github.com/jubewe/oberknecht-client-test>

### 1. Install the package via the node package manager (npm):

```bash
npm install oberknecht-client
```

### 2. Import the client into your file:

{% code title="index.js" %}

```javascript
const { oberknechtClient } = require("oberknecht-client");
```

{% endcode %}

```typescript
import { oberknechtClient } from "oberknecht-client";
```

### 3. Create a new oberknechtClient

```javascript
const oberknecht = new oberknechtClient(<clientOptions>);
```

{% code title="Example" %}

```javascript
const client = new oberknechtClient({
    token: "bbxxpxcy1w248ajgb4rkeytdkdwffd",
    // Token link generator: https://jubewe.de/twitch/oauthlink
    username: "jubewe",
    channels: ["jubewe", "ju_b0t"]
});
```

{% endcode %}

### 4. Connect client to chat

```javascript
client.connect();
```

### 5. Add a event listener

> Event Types: <https://github.com/jubewe/oberknecht-client/blob/master/lib/src/oberknecht.emitter.events.js>

```javascript
client.on("<event>", (callback) => {})
```

{% hint style="success" %}
GitHub Repository

<https://github.com/jubewe/oberknecht-client>
{% endhint %}

{% hint style="success" %}
NPM Package

<https://www.npmjs.com/package/oberknecht-client>
{% endhint %}
