Coming from noblox.js
If you’re coming from noblox.js, this guide will help you understand how RoZod differs and how to migrate your code.
Key Differences
Section titled “Key Differences”| noblox.js | RoZod | |
|---|---|---|
| Language | JavaScript | TypeScript-first |
| API style | High-level wrapper functions | Direct endpoint calls with fetchApi |
| Type safety | Partial (DefinitelyTyped) | Full — every parameter and response is typed via Zod |
| Auth | setCookie() | configureServer({ cookies: '...' }) |
| Error handling | Throws errors | Returns AnyError union (or throws with throwOnError) |
| OpenCloud | Not supported | 115+ OpenCloud endpoints built-in |
| Endpoint coverage | Subset of Roblox APIs | 810+ endpoints, auto-generated from official docs |
Authentication
Section titled “Authentication”const noblox = require('noblox.js');await noblox.setCookie('_|WARNING:-DO-NOT-SHARE-THIS...');
// RoZodimport { configureServer } from 'rozod';configureServer({ cookies: '_|WARNING:-DO-NOT-SHARE-THIS...' });RoZod also supports cookie pools with rotation — see Authentication.
Making API Calls
Section titled “Making API Calls”noblox.js provides high-level wrapper functions. RoZod gives you direct access to every Roblox API endpoint with full type safety.
Getting User Info
Section titled “Getting User Info”const user = await noblox.getPlayerInfo(1);console.log(user.username);
// RoZodimport { fetchApi, isAnyErrorResponse } from 'rozod';import { getUsersUserid } from 'rozod/lib/endpoints/usersv1';
const user = await fetchApi(getUsersUserid, { userId: 1 });if (!isAnyErrorResponse(user)) { console.log(user.name);}Getting Group Info
Section titled “Getting Group Info”const group = await noblox.getGroup(1);
// RoZodimport { getGroupsGroupid } from 'rozod/lib/endpoints/groupsv1';
const group = await fetchApi(getGroupsGroupid, { groupId: 1 });Getting Group Members
Section titled “Getting Group Members”const members = await noblox.getPlayers(groupId);
// RoZod — with paginationimport { fetchApiPages } from 'rozod';import { getGroupsGroupidUsers } from 'rozod/lib/endpoints/groupsv1';
const pages = await fetchApiPages( getGroupsGroupidUsers, { groupId: 1, limit: 100 },);Changing a User’s Role
Section titled “Changing a User’s Role”await noblox.setRank(groupId, userId, roleId);
// RoZodimport { patchGroupsGroupidUsersUserid } from 'rozod/lib/endpoints/groupsv1';
await fetchApi(patchGroupsGroupidUsersUserid, { groupId: 1, userId: 123, body: { roleId: 456 },});Error Handling
Section titled “Error Handling”noblox.js throws errors. RoZod returns a union type by default:
try { const user = await noblox.getPlayerInfo(1);} catch (err) { console.error(err);}
// RoZod (default — union return)const user = await fetchApi(getUsersUserid, { userId: 1 });if (isAnyErrorResponse(user)) { console.error(user.message); console.error(user.code); // error code (string or number, if available) console.error(user.field); // field that caused the error (if available)} else { console.log(user.name);}
// RoZod (throw mode — closer to noblox.js behavior)try { const user = await fetchApi(getUsersUserid, { userId: 1 }, { throwOnError: true }); console.log(user.name);} catch (err) { console.error(err.message);}Finding Endpoints
Section titled “Finding Endpoints”In noblox.js, you’d look for a wrapper function like noblox.getGroup(). In RoZod, you import the endpoint directly from the corresponding service module.
Naming convention: {method}{PathSegments} in camelCase.
GET /v1/users/:userId→getUsersUseridfromusersv1POST /v1/usernames/users→postUsernamesUsersfromusersv1GET /v1/groups/:groupId→getGroupsGroupidfromgroupsv1
Browse the full list in the Classic API Reference.
What RoZod Doesn’t Have
Section titled “What RoZod Doesn’t Have”RoZod is a lower-level library than noblox.js. It doesn’t include:
- Combined/convenience functions — noblox.js has functions like
getPlayers()that internally call multiple endpoints and merge results. In RoZod, you compose these yourself usingfetchApi+fetchApiPages. - Built-in rate limiting — You manage rate limiting yourself (or use retry options).
- Event polling — noblox.js has event listener functions (e.g.,
onShout,onJoinRequest) that poll for changes. RoZod doesn’t include these, but you can build them withsetInterval+fetchApi.
The trade-off is full type safety, complete endpoint coverage, and a transparent API where you always know exactly which Roblox endpoint you’re calling.