https://github.com/buape/kiai.js
https://github.com/buape/kiai.js
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/buape/kiai.js
- Owner: buape
- License: mit
- Created: 2025-01-16T17:02:04.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-12T23:40:51.000Z (3 months ago)
- Last Synced: 2025-03-13T03:51:18.716Z (about 2 months ago)
- Language: TypeScript
- Size: 76.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# kiai.js
[](https://www.npmjs.com/package/kiai.js)
[](https://github.com/buape/kiai.js/blob/main/LICENSE)
[](https://github.com/buape/kiai.js/actions)
[](https://nodejs.org)The official JavaScript/TypeScript API library for Kiai - a powerful Discord leveling and rewards system.
## Installation
```bash
# Using npm
npm install kiai.js# Using yarn
yarn add kiai.js# Using pnpm
pnpm add kiai.js# Using bun
bun add kiai.js
```## Quick Start
```typescript
import { KiaiClient } from 'kiai.js';// Initialize the client
const kiai = new KiaiClient({
apiKey: 'your-api-key'
});// Example: Get user level
const userLevel = await kiai.leveling.getUserLevel('guild_id', 'user_id');
console.log(`User level: ${userLevel}`);
```## Documentation
For detailed documentation, visit our [documentation site](https://kiai.app/docs/kiai.js).
## Handlers
kiai.js provides several handlers to interact with different aspects of the API. These handlers mirror the API categories on our [API docs](https://api.kiai.app/v2/docs).
- `Leveling` - Manage user levels and XP
- `Rewards` - Configure and manage level rewards
- `LeaderboardRoles` - Handle leaderboard-based role assignments
- `Settings` - Manage guild settings
- `Multipliers` - Configure XP multipliers
- `Denylist` - Manage denied channels and roles
- `Misc` - Miscellaneous API interactions## Examples
### Working with Levels
```typescript
// Get user XP
const xp = await kiai.leveling.getUserXp('guild_id', 'user_id');// Add XP to user
await kiai.leveling.addXp('guild_id', 'user_id', 100);// Get guild leaderboard
const leaderboard = await kiai.leveling.getLeaderboard('guild_id');
```### Managing Rewards
```typescript
// Add a level reward
await kiai.rewards.createReward('guild_id', {
level: 10,
roleId: 'role_id'
});// Get all rewards
const rewards = await kiai.rewards.getRewards('guild_id');
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Support
- [GitHub Issues](https://github.com/buape/kiai.js/issues)
- [Discord Server](https://discord.gg/NNNsHfbrm2)## Credits
Developed and maintained by [Buape Studios](https://buape.com).