TopStats SDK

Lua analytics SDK

Lua has no standard HTTP, JSON or timers, so the core takes a platform table - http, set_timeout, json_encode, now_iso, log, random - and everything else (batching, retries, queue bounds, the wire contract) is shared, tested code. The FiveM, Garry’s Mod and Roblox integrations are thin platform tables over this exact file.

Install

-- vendored: copy src/topstats.lua into your project (the integrations do this with a CI drift check)

Capture your first event

local TopStatsCore = require('topstats')

local client = TopStatsCore.new(platform, { api_key = os.getenv('TOPSTATS_API_KEY') })
client:capture('zone_captured', { zone = 'north' }, { actor = 'player-1' })
client:flush()

Behaviour you can rely on

Every other language

Your first event is minutes away.

Twelve language SDKs, middleware for nine web frameworks, plugins for seven games, and raw HTTP - all working today. Free plan, 2M events a month, no card.