@rigbyhost/sdk-ts
v0.1.1
Published
The official TypeScript SDK for interacting with the Rigby API. Fully typed with Zod schemas.
Readme
RigbySDK TS
The official TypeScript SDK for interacting with the Rigby API. Fully typed with Zod schemas.
Installation
bun install @rigbyhost/sdk-ts
# or
npm install @rigbyhost/sdk-tsGetting Started
Initialize the SDK with your API token.
import { RigbySDK } from "@rigbyhost/sdk-ts";
const sdk = new RigbySDK("YOUR_API_TOKEN");Usage
GDPS Configuration
Manage server settings, chest configurations, and security.
// Get server config
const config = await sdk.gdps.config.get({ srvId: "my-server-id" });
// Update chest config
await sdk.gdps.config.updateChests({
srvId: "my-server-id",
chestConfig: {
ChestSmallOrbsMin: 50,
// ...
}
});User Management
Interact with the authenticated user session.
// Get current user profile
const me = await sdk.user.me();
// Update profile
await sdk.user.updateProfile({
firstName: "Rigby",
lastName: "Fan"
});Content Management
Manage levels, music, and roles.
// Search levels
const levels = await sdk.gdps.levels.search({
srvId: "my-server-id",
query: "demon"
});
// Update level rating
await sdk.gdps.levels.updateRating({
srvId: "my-server-id",
levelId: 123,
difficulty: 5,
stars: 10,
isFeatured: true,
// ...
});
// Add music from Newgrounds
await sdk.gdps.music.createFromNewgrounds({
srvId: "my-server-id",
newgroundsId: 123456
});Notifications
Manage user notifications.
// List notifications
const notes = await sdk.notifications.list();
// Mark all as read
await sdk.notifications.markAllAsRead();Types
This SDK uses Zod for validation. You can import inferred types if needed, though the SDK methods are fully typed.
import { type ServerConfig } from "@rigbyhost/sdk-ts/src/types/serverConfig";