TypeScript client library for Rotector's user and group checking APIs
Find a file
2026-04-11 09:16:22 +00:00
src updated base endpoint URL 2025-12-28 03:08:46 +09:00
.eslintrc.json Initial commit – Rotector Wrapper library 2025-11-13 14:41:05 +08:00
.gitignore Initial commit – Rotector Wrapper library 2025-11-13 14:41:05 +08:00
package.json updated with new API documentation and extra features 2025-11-21 19:39:32 +08:00
README.md Update README.md 2026-04-11 09:16:22 +00:00
tsconfig.json updated with new API documentation and extra features 2025-11-21 19:39:32 +08:00

This project is no longer being updated and most likely doesnt function anymore

Rotector Wrapper

A lightweight, strongly typed TypeScript client for the Rotector Safety API. Easily check Roblox user and group safety, batch hundreds of IDs efficiently, and work with enums & helper utilities.


Installation

Bun

bun add rotector-wrapper

npm

npm install rotector-wrapper

yarn

yarn add rotector-wrapper

Usage

Basic Example

import { RotectorClient } from "rotector-wrapper";

const client = new RotectorClient({
  baseUrl: "https://roscoe.robalyx.com",
  timeout: 10000,
  maxRetries: 3,
});

async function main() {
  const user = await client.checkUserStatus(123456);
  console.log("Single User:", user);

  const users = await client.checkMultipleUsers([123456, 789012]);
  console.log("Batch Users:", users);

  const group = await client.checkGroupStatus(987654);
  console.log("Single Group:", group);

  const groups = await client.checkMultipleGroups([987654, 654321]);
  console.log("Batch Groups:", groups);
}

main();

Features

✔ Single user lookup

✔ Batch user lookup (object keyed by userId)

✔ Single group lookup

✔ Batch group lookup

✔ Retry logic

✔ Timeouts

✔ Request cancellation

✔ Caching (optional)

✔ Enums + helper utilities


User Lookup

const user = await client.checkUserStatus(123456);
console.log(user.flagType);
console.log(user.reasons);

Batch User Lookup

Returns: Record<string, UserStatus>

const users = await client.checkMultipleUsers([123456, 789012]);

console.log(users["123456"]);

Example output:

{
  "123456": {
    "id": 123456,
    "flagType": 2,
    "confidence": 0.95,
    "reasons": {
      "Inappropriate Content": { ... }
    }
  },
  "789012": {
    "id": 789012,
    "flagType": 0,
    "reasons": {}
  }
}

Group Lookup

Single group:

const group = await client.checkGroupStatus(1035713);

Batch groups (object):

const groups = await client.checkMultipleGroups([1035713, 35396105]);
console.log(groups["1035713"]);

Helper Utilities

Human-readable flag name

getFlagName(user.flagType);

Check if flag is unsafe

isUnsafeFlag(user.flagType);

Get readable user reason descriptions

getReasonDescriptions(user.reasons);

Get readable group reason descriptions

getGroupReasonDescriptions(group.reasons);

Enums

FlagType

0 SAFE  
1 PENDING  
2 UNSAFE  
3 QUEUED  
4 INTEGRATION  
5 MIXED  
6 PAST_OFFENDER  

UserReasonType

0 USER_PROFILE  
1 FRIEND_NETWORK  
2 AVATAR_OUTFIT  
3 GROUP_MEMBERSHIP  
4 CONDO_ACTIVITY  
5 CHAT_MESSAGES  
6 GAME_FAVORITES  
7 EARNED_BADGES  
8 USER_CREATIONS  
9 OTHER_REASONS  

GroupReasonType

0 MEMBER  
1 PURPOSE  
2 DESCRIPTION  
3 SHOUT  

API Methods

checkUserStatus(userId)

Returns:

{
  id: number;
  flagType: number;
  confidence?: number;
  lastUpdated?: number;
  reasons: Record<string, unknown>;
}

checkMultipleUsers(userIds)

Returns:

Record<string, UserStatus>

checkGroupStatus(groupId)

Returns group safety object.


checkMultipleGroups(groupIds)

Returns:

Record<string, GroupStatus>

Caching Example

const client = new RotectorClient({ enableCache: true });

await client.checkUserStatus(123); // real request
await client.checkUserStatus(123); // cached

Cancelable Requests

const { cancel, response } = client.checkUserStatusCancelable(123);

cancel(); // aborts immediately

await response; // throws AbortError

License

MIT