Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Kient
https://github.com/zsoulweaver/kient
Admin
TypeScript-First Client Library for Kick's Public API
Tokens:
297
Snippets:
2
Trust Score:
6
License:
MIT
Update:
1 year ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Install Kient using Bun Source: https://github.com/zsoulweaver/kient/blob/master/README.md This command installs the Kient library using the Bun package manager. It is a prerequisite for using the library in your TypeScript project. ```bash bun add kient ``` -------------------------------- ### Initialize Kient and Interact with Kick API (TypeScript) Source: https://github.com/zsoulweaver/kient/blob/master/README.md This TypeScript code demonstrates how to initialize the Kient library, set an authentication token, and interact with various Kick API endpoints. It includes examples for fetching the authorized user, retrieving channels by ID, and sending chat messages. Ensure the KICK_TOKEN environment variable is set. ```typescript 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, }) ```