Skip to content

zSoulweaver/kient

Repository files navigation

Kient

About

Kient (Kick-Client) is a versatile TypeScript library designed to simplify interaction with Kick's API and Webhooks. With Kient, you can seamlessly integrate Kick's platform into your projects, making it easier than ever to leverage its capabilities.

Documentation

Learn how to use Kient and find detailed information on the website - Very much WIP.

Installation and Example Usage

Install Kient with your preferred package manager.

$ bun add kient

Import Kient, create a new instance, and interact with API endpoints or listen to WebSocket events.

import { env } from 'bun'
import { Kient } from 'kient'

// Create a new kient instance
const kient = new Kient()

// Set the authentication token
kient.setAuthToken(env.KICK_TOKEN as string)

// Get the currently authorised user
const currentUser = await kient.api.channel.getAuthorisedUser()
// Log the raw output
console.log(currentUser.raw)

// Retrieve multiple channels by their ID
const multipleUsers = await kient.api.channel.getByIds([1, 2, 3])

// Send a chat message to the first channel in the above list as the authenticated user
await kient.api.chat.send({
	type: 'user',
	message: 'Message will be send to specified user id below',
	userId: multipleUsers[0].id,
})

License

Kient is licensed under the MIT License.