Rivo FX

Free developer library for FiveM: typed errors, fibers, validated net events, typed RPC, cleanup that runs, metrics, tracing and in-game devtools. Lua and TypeScript.

Free

By Rivo

The /fxdev overview: live fibers, timers, spans and failures per resource
A client RPC and its server handler as one trace in /fxdev
Live fibers grouped per resource in /fxdev
Metrics with histogram percentiles in /fxdev
The light theme of /fxdev

Description

Rivo FX

Typed, safe FiveM scripting for developers. Rivo FX brings the model of Effect to FiveM Lua and TypeScript: errors you can see, fibers that clean up after themselves, services through Layers, and a schema on every payload that crosses a trust boundary.

Free and MIT licensed. Source on GitHub.

What it fixes

  • Net events that validate first. A handler never sees a payload that fails its schema, and every player is rate limited per event by default. Rejected payloads become security events you can log or send to a webhook.
  • RPC with timeouts and typed errors. A NotEnoughMoney raised on the server arrives on the client as NotEnoughMoney. Calls time out and cancel the handler. Defects never leak details to clients.
  • Cleanup that actually runs. Scopes close when the resource stops or the player drops: spawned entities deleted, models released, in-flight handlers interrupted.
  • No more endless while not HasModelLoaded do Wait(0) end. Asset loads have timeouts and typed errors.

What's inside

  • Core: effects, typed errors, fibers and structured concurrency, scopes, Layers, retry schedules, Schema, Streams
  • FiveM: validated net events, typed RPC (with ox_lib callback compatibility), security events, players, typed convars, assets, scoped entities, KVP, schema-typed state bags, oxmysql, ticks, NUI
  • Frameworks: one player, money and job API over ESX, QBCore, Qbox and standalone
  • Observability: metrics and tracing across client and server, with a token-protected Prometheus endpoint
  • Devtools: /fxdev in game shows live fibers, traces, failures and metrics for every resource, on the server and your client
  • TypeScript: @rivolabs/fx on npm for JS resources on the real Effect package, @rivolabs/fx-nui for NUI pages, and the rivo-fx CLI to generate schemas for every side

Install

  1. Download rivo_fx.zip, put rivo_fx in your resources and ensure rivo_fx first.
  2. In your resource: dependency 'rivo_fx' and shared_script '@rivo_fx/init.lua'.

Full docs, recipes and a migration guide are in the docs tab. For AI assistants, the whole reference is one file: llms-full.md.

Details

  • For: script developers. Players see nothing unless you build it.
  • Framework: standalone, with layers for ESX, QBCore and Qbox
  • Dependencies: none. oxmysql and ox_lib are used when present.
  • Source: open, MIT, not escrowed
  • Runtime: Lua 5.4; JS/TS through @rivolabs/fx

Compatibility

  • standalone
  • esx
  • qbcore
  • qbox

Requirements

  • standalone
  • esx
  • qbcore
  • qbox
  • oxmysql
  • ox_lib

Tags

  • standalone
  • developer
  • library
  • open-source

Rivo FX documentation