# Sinlyxe SDK — CS2 Commend Bot, Steam Report Bot, StatTrak Boost & More

Official Node.js SDK for the [Sinlyxe API](https://sinlyxe.cc) — the all-in-one platform for CS2 and Steam automation services.

Programmatically send **CS2 commends**, **Steam profile reports**, **StatTrak kill boosts**, **Steam profile comments**, **artwork comments**, **Steam likes**, **Steam favorites**, manage **Steam hourboost** accounts (with **commends, StatTrak kills, and achievement unlocking while hourboosting**), and monitor **VAC / game bans** with the watchlist — all through a single API.

## What Can You Do?

| Service | Description |
|---------|-------------|
| **CS2 Commend Bot** | Send friendly, teacher, and leader commends to any CS2 player |
| **Steam Report Bot** | Submit Steam profile reports through proxied accounts |
| **StatTrak Boost** | Add kills to any StatTrak weapon (knives, AWPs, AKs, etc.) |
| **Steam Comment Bot** | Post comments on Steam profiles and artwork/screenshots |
| **Steam Likes** | Add likes (upvotes) to artwork, screenshots, workshop items, guides, and reviews |
| **Steam Favorites** | Add favorites to artwork, screenshots, workshop items, and guides (reviews not supported) |
| **Steam Hourboost** | Keep Steam accounts online 24/7 with custom game lists and card farming |
| ↳ Commends while Hourboosting | Receive CS2 commends on your bot accounts while they're idling — premium |
| ↳ StatTrak while Hourboosting | Get StatTrak kills on your bot accounts while they're idling — premium |
| ↳ Achievement Unlocker | Unlock Steam achievements + bump stats on your bot accounts headlessly — premium |
| **Ban Checker / Watchlist** | Monitor Steam profiles for VAC bans, game bans, and community bans |

## Features

- Zero dependencies — uses native `fetch` (Node.js 18+)
- Full TypeScript support with type definitions
- Comprehensive error handling with typed errors
- Rate limit information on every request
- Webhook signature verification for real-time events

## Installation

```bash
npm install sinlyxe-api
```

## Requirements

- Node.js 18.0.0 or higher (uses native fetch)
- A Sinlyxe API key — get one at [sinlyxe.cc](https://sinlyxe.cc)

## Quick Start

```javascript
import Sinlyxe from 'sinlyxe-api';

const client = new Sinlyxe('sinlyxe_your_api_key');

// Send CS2 commends
const commendSession = await client.commend.create({
  steamId: '76561198123456789',
  friendly: 50,
  teacher: 30,
  leader: 20
});

// Boost StatTrak kills on a weapon
const stattrakSession = await client.stattrak.create({
  steamId: '76561198123456789',
  itemId: '27684173074',
  count: 1000
});

// Check account limits
const account = await client.account.get();
console.log(`Daily commends remaining: ${account.limits.commend.daily_remaining}`);
```

## API Reference

### Initialization

```javascript
import Sinlyxe from 'sinlyxe-api';

// Basic usage
const client = new Sinlyxe('sinlyxe_your_api_key');

// With options
const client = new Sinlyxe('sinlyxe_your_api_key', {
  timeout: 60000  // Request timeout in ms (default: 30000)
});
```

### Account

```javascript
// Get account information and limits
const account = await client.account.get();
console.log(account.username);
console.log(account.limits.commend.daily_remaining);

// Get API usage statistics
const usage = await client.account.usage();
console.log(usage.total_requests);
console.log(usage.last_24h_requests);
```

### CS2 Commend Bot

Send commends to any CS2 player's profile. Supports per-type control (friendly, teacher, leader) or a single amount for all three.

```javascript
// Create commend session with per-type control (recommended)
// Cost is calculated as max(friendly, teacher, leader)
const session = await client.commend.create({
  steamId: '76561198123456789', // Steam ID, profile URL, or vanity URL
  friendly: 50,                 // Number of friendly commends
  teacher: 30,                  // Number of teacher commends
  leader: 20                    // Number of leader commends
});
console.log(session.session_id);
// Cost: 50 (the highest of the three)

// Legacy format (sends all 3 types with same count)
const session = await client.commend.create({
  steamId: '76561198123456789',
  amount: 10  // Sends 10 friendly, 10 teacher, 10 leader
});

// Get session status (includes per-type progress)
const status = await client.commend.get(session.session_id);
console.log(status.status);              // 'QUEUED', 'running', 'done', 'canceled'
console.log(status.success);             // Total successful
console.log(status.friendly_completed);  // Friendly commends completed
console.log(status.teacher_completed);   // Teacher commends completed
console.log(status.leader_completed);    // Leader commends completed

// List sessions
const sessions = await client.commend.list({
  status: 'done',  // Optional filter
  limit: 50        // Max 100
});

// Cancel session
await client.commend.cancel(sessionId);
```

### Steam Report Bot

Submit Steam profile reports through proxied accounts.

```javascript
// Create report session
const session = await client.report.create({
  steamId: '76561198123456789'
});

// Get session status
const status = await client.report.get(session.session_id);

// List sessions
const sessions = await client.report.list({ limit: 20 });
```

### Steam Comment Bot

Post comments on Steam profiles or artwork/screenshots. Supports multiple comment styles.

```javascript
// Profile comment
const session = await client.comment.create({
  steamId: '76561198123456789',
  amount: 5  // 1-50 comments
});

// Profile comment with specific styles
const session = await client.comment.create({
  steamId: '76561198123456789',
  amount: 10,
  categories: ['rep', 'sign']  // 'default', 'rep', 'sign', 'artwork', 'cheater'
});

// Artwork / screenshot comment (just paste the sharedfile URL)
const session = await client.comment.create({
  steamId: 'https://steamcommunity.com/sharedfiles/filedetails/?id=3456789012',
  amount: 10,
  categories: ['artwork']  // auto-selected if omitted
});

// Get session status
const status = await client.comment.get(session.session_id);
console.log(status.status);     // 'QUEUED', 'running', 'done', 'canceled'
console.log(status.success);
console.log(status.artworkId);  // null for profile comments

// List sessions
const sessions = await client.comment.list({ limit: 20 });

// Cancel session (remaining comments are refunded)
await client.comment.cancel(sessionId);
```

### Steam Likes

Add likes (upvotes) to any Steam shared file (artwork, screenshots, workshop items, guides) **or Steam reviews**. Each like uses one distinct bot account.

```javascript
// Sharedfile (artwork, screenshot, workshop item, guide)
const session = await client.like.create({
  steamId: 'https://steamcommunity.com/sharedfiles/filedetails/?id=3456789012',
  amount: 10  // Number of likes
});
console.log(session.session_id);
console.log(session.target_type); // 'sharedfile'

// Steam review (helpful vote)
const reviewSession = await client.like.create({
  steamId: 'https://steamcommunity.com/id/example/recommended/440/',
  amount: 10
});
console.log(reviewSession.target_type); // 'review'

// Get session status
const status = await client.like.get(session.session_id);
console.log(status.status);      // 'QUEUED', 'running', 'done', 'canceled'
console.log(status.success);

// List sessions
const sessions = await client.like.list({ limit: 20 });

// Cancel session (remaining likes are refunded)
await client.like.cancel(sessionId);
```

**Supported review URL formats:**
- `https://steamcommunity.com/id/{vanity}/recommended/{appid}/`
- `https://steamcommunity.com/profiles/{steamid64}/recommended/{appid}/`

### Steam Favorites

Add favorites to any Steam shared file — artwork, screenshots, workshop items, and guides. Each favorite uses one distinct bot account.

> **Note:** Steam reviews cannot be favorited — only liked. Use `client.like.create()` for reviews.

```javascript
// Queue a favorite session (pass the sharedfile URL)
const session = await client.favorite.create({
  steamId: 'https://steamcommunity.com/sharedfiles/filedetails/?id=3456789012',
  amount: 10  // Number of favorites
});
console.log(session.session_id);

// Get session status
const status = await client.favorite.get(session.session_id);
console.log(status.status);      // 'QUEUED', 'running', 'done', 'canceled'
console.log(status.success);

// List sessions
const sessions = await client.favorite.list({ limit: 20 });

// Cancel session (remaining favorites are refunded)
await client.favorite.cancel(sessionId);
```

### StatTrak Boost

Add kills to any StatTrak weapon — works with knives, AWPs, AKs, pistols, and all other StatTrak items. The target must be connected to a CS2 server during the boost.

```javascript
// Queue a StatTrak boost session
const session = await client.stattrak.create({
  steamId: '76561198123456789',    // Steam ID, profile URL, or vanity URL
  itemId: '27684173074',           // Item asset ID (from inventory link)
  count: 1000                      // Number of kills to add
});
console.log(session.session_id);

// Get session status
const status = await client.stattrak.get(session.session_id);
console.log(status.status);           // 'QUEUED', 'running', 'done', 'canceled', 'crashed_refunded', 'target_disconnected'
console.log(status.requested);          // Total kills requested
console.log(status.success);            // Kills succeeded
console.log(status.failed);             // Kills failed

// List sessions
const sessions = await client.stattrak.list({
  status: 'done',  // Optional filter
  limit: 50        // Max 100
});

// Cancel session (remaining kills are refunded)
await client.stattrak.cancel(sessionId);
```

### Steam Hourboost — Accounts

Keep your Steam accounts online 24/7 with custom game lists, card farming, and auto-accept friends.

```javascript
// List all accounts
const accounts = await client.hourboost.accounts.list();

// Add new account
const account = await client.hourboost.accounts.add({
  username: 'steam_user',
  password: 'steam_pass',
  sharedSecret: 'optional_2fa_secret'  // Optional
});

// Get account details
const details = await client.hourboost.accounts.get('steam_user');

// Update account settings
await client.hourboost.accounts.update('steam_user', {
  onlineStatus: true,
  autoAcceptFriends: true,
  receiveCommends: false,
  cardFarming: false,
  customGame: 'Custom Game Name',
  gameListId: 123
});

// Start/Stop hourboost
await client.hourboost.accounts.start('steam_user');
await client.hourboost.accounts.stop('steam_user');

// Submit Steam Guard code (when required)
await client.hourboost.accounts.submitGuard('steam_user', '12345');

// Set game list
await client.hourboost.accounts.setGameList('steam_user', 123);

// Remove account
await client.hourboost.accounts.remove('steam_user');
```

### Steam Hourboost — Game Lists

```javascript
// List all game lists
const lists = await client.hourboost.gamelists.list();

// Create game list
const list = await client.hourboost.gamelists.create({
  name: 'My Games',
  games: [730, 570, 440]  // CS2, Dota 2, TF2
});

// Get game list
const details = await client.hourboost.gamelists.get(listId);

// Update game list
await client.hourboost.gamelists.update(listId, {
  name: 'Updated Name',
  games: [730, 570, 440, 252490]  // Added Rust
});

// Delete game list
await client.hourboost.gamelists.delete(listId);
```

### Ban Checker / Watchlist

Monitor Steam profiles for VAC bans, game bans, and community bans. Get notified via webhooks when a ban is detected.

```javascript
// Add a Steam profile to the watchlist
const entry = await client.watchlist.add({
  steamId: '76561198123456789'  // Steam ID, profile URL, or vanity URL
});
console.log(entry.display_name);

// List watchlist entries
const entries = await client.watchlist.list({
  status: 'banned',  // 'all', 'banned', or 'active' (default: 'all')
  limit: 50          // Max 100
});

// Get specific entry
const entry = await client.watchlist.get('76561198123456789');
console.log(entry.banned);       // true/false
console.log(entry.ban_type);     // 'v' (VAC), 'g' (game), 'c' (community), or null
console.log(entry.vac_bans);     // Number of VAC bans
console.log(entry.game_bans);    // Number of game bans

// Remove from watchlist
await client.watchlist.remove('76561198123456789');
```

## Error Handling

```javascript
import Sinlyxe, {
  SinlyxeError,
  AuthError,
  RateLimitError,
  ValidationError,
  ForbiddenError,
  NotFoundError,
  ConflictError,
  ServiceUnavailableError
} from 'sinlyxe-api';

try {
  await client.commend.create({ steamId: '...', friendly: 10, teacher: 10, leader: 10 });
} catch (error) {
  if (error instanceof RateLimitError) {
    console.log(`Rate limited. Retry after ${error.retryAfter} seconds`);
  } else if (error instanceof AuthError) {
    console.log('Invalid API key or IP not bound');
  } else if (error instanceof ForbiddenError) {
    console.log('Access denied:', error.message);
  } else if (error instanceof ValidationError) {
    console.log('Invalid input:', error.message);
  } else if (error instanceof NotFoundError) {
    console.log('Not found:', error.message);
  } else if (error instanceof ConflictError) {
    console.log('Conflict:', error.message);
  } else if (error instanceof ServiceUnavailableError) {
    console.log('Service unavailable:', error.message);
  } else if (error instanceof SinlyxeError) {
    console.log(`API Error (${error.status}): ${error.message}`);
  }
}
```

## Rate Limits

The API has a rate limit of 200 requests per minute per API key. Rate limit information is available after each request:

```javascript
await client.account.get();

console.log(client.rateLimit);
// {
//   limit: 30,
//   remaining: 29,
//   reset: 1706384400  // Unix timestamp
// }
```

## Webhook Verification

When receiving webhooks, verify the signature to ensure authenticity:

```javascript
import Sinlyxe from 'sinlyxe-api';

// In your webhook handler (e.g., Express)
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-sinlyxe-signature'];
  const isValid = Sinlyxe.verifyWebhook(req.body, signature, 'your_webhook_secret');

  if (!isValid) {
    return res.status(401).send('Invalid signature');
  }

  // Process webhook
  const event = req.body;
  console.log('Received event:', event.type);

  res.status(200).send('OK');
});
```

### Webhook Events

**CS2 Commend Bot events:**
- `commend.started` / `commend.progress` / `commend.completed`

**Steam Report Bot events:**
- `report.started` / `report.progress` / `report.completed`

**Steam Comment Bot events:**
- `comment.started` / `comment.progress` / `comment.completed`

**StatTrak Boost events:**
- `stattrak.started` / `stattrak.progress` / `stattrak.completed`

**Ban Checker / Watchlist events:**
- `watchlist.ban_detected` — VAC or game ban detected. Data: `{ steam_id, display_name, ban_type, days_since_last_ban }`
- `watchlist.community_ban` — Community ban detected. Data: `{ steam_id, display_name }`
- `watchlist.community_unban` — Community ban removed. Data: `{ steam_id, display_name }`

## Links

- [Sinlyxe Website](https://sinlyxe.cc)
- [Steam Level Up Service](https://sinlyxe.cc/levelup)
- [TF2 Key & Gem Exchange](https://sinlyxe.cc/exchange)

## License

MIT
