Installation
Install
Section titled “Install”npm install rozodbun add rozodpnpm add rozodyarn add rozodRequirements
Section titled “Requirements”- TypeScript 5.0+ — RoZod relies on modern TypeScript features for type inference
- Node.js 18+, Bun, or Deno — any runtime with a global
fetchimplementation - Also works in browsers and browser extensions (Chrome, Firefox, etc.)
What’s Included
Section titled “What’s Included”RoZod has three runtime dependencies:
- zod — Schema definitions that power type inference (not used for runtime validation)
- roblox-bat — Hardware-backed authentication (HBA) header generation
- parse-roblox-errors — Structured error parsing for Roblox API responses
All endpoint type definitions are included in the package at zero runtime cost.
Project Structure
Section titled “Project Structure”After installing, you import endpoints from their respective modules:
// Core functionsimport { fetchApi, configureServer } from 'rozod';
// Classic API endpoints (one file per Roblox service)import { getUsersUserid } from 'rozod/endpoints/usersv1';import { getGroupsGroupid } from 'rozod/endpoints/groupsv1';
// OpenCloud endpointsimport { v1, v2 } from 'rozod/opencloud';Each endpoint file maps to a Roblox API service (e.g., usersv1, groupsv1, catalogv1). See the API Reference for a full list.
TypeScript Module Resolution
Section titled “TypeScript Module Resolution”The rozod/endpoints/* and rozod/opencloud subpaths are declared via package.json#exports. TypeScript only reads exports when moduleResolution is set to node16, nodenext, or bundler:
{ "compilerOptions": { "moduleResolution": "bundler" // or "node16" / "nodenext" }}If you’re on the classic "node" resolution (the default on older configs), the new subpaths won’t resolve. You can either switch moduleResolution to one of the above, or keep using the rozod/lib/endpoints/... and rozod/lib/opencloud paths, which remain supported.