SDK Documentation

Install in <10 Seconds

Drop one ModuleScript into your Roblox game and unlock the full RoFlow feature set.

01

Generate an API Key

Go to Settings → SDK API Keys and click "Generate key". Copy the full key - it's shown once.

02

Add the ModuleScript

Create a ModuleScript in ServerScriptService named "RoFlowSDK". Paste the code below.

03

Require & Use

Require the module in any ServerScript. Check permissions, log mod actions, fire modcalls.

Claim your Place ID first

In Settings → Claimed Places, add your Roblox experience's Place ID before installing the SDK. Requests from unclaimed places are rejected.

RoFlowSDK ModuleScript

Copy this into a ModuleScript at ServerScriptService → RoFlowSDK. Replace the API key at the top.

RoFlowSDK.lua
-- RoFlow SDK v1
-- Drop this ModuleScript into ServerScriptService

local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")

local RoFlow = {}

local API_KEY = "rfk_YOUR_KEY_HERE"   -- From Settings → SDK API Keys
local API_BASE = "https://roflow.org/api/sdk"

local function request(endpoint: string, method: string, body: any?)
  local ok, res = pcall(function()
    return HttpService:RequestAsync({
      Url = API_BASE .. endpoint,
      Method = method or "GET",
      Headers = {
        ["Content-Type"] = "application/json",
        ["X-Api-Key"] = API_KEY,
      },
      Body = body and HttpService:JSONEncode(body) or nil,
    })
  end)
  if not ok then return nil end
  if res.StatusCode ~= 200 then return nil end
  return HttpService:JSONDecode(res.Body)
end

-- Check if a player has a permission key
function RoFlow.hasPermission(player: Player, key: string): boolean
  local data = request("/permission?userId=" .. player.UserId .. "&key=" .. key, "GET")
  return data ~= nil and data.granted == true
end

-- Log a moderation action
function RoFlow.logModAction(actorId: number, targetId: number, action: string, reason: string?)
  request("/modaction", "POST", {
    actorId = actorId,
    targetId = targetId,
    action = action,
    reason = reason or "",
  })
end

-- Fire a modcall (player requests moderator)
function RoFlow.modcall(player: Player, message: string?)
  request("/modcall", "POST", {
    userId = player.UserId,
    username = player.Name,
    message = message or "",
    placeId = game.PlaceId,
    jobId = game.JobId,
  })
end

-- Track session start
function RoFlow.sessionStart(player: Player)
  request("/session/start", "POST", {
    userId = player.UserId,
    placeId = game.PlaceId,
    jobId = game.JobId,
  })
end

-- Track session end
function RoFlow.sessionEnd(player: Player)
  request("/session/end", "POST", {
    userId = player.UserId,
    placeId = game.PlaceId,
    jobId = game.JobId,
  })
end

-- Wire up automatic session tracking
Players.PlayerAdded:Connect(function(player)
  RoFlow.sessionStart(player)
end)

Players.PlayerRemoving:Connect(function(player)
  RoFlow.sessionEnd(player)
end)

return RoFlow

Usage Example

Require the module in any server-side script:

ServerScript.lua
-- In your ServerScript:
local RoFlow = require(game.ServerScriptService.RoFlowSDK)

-- Permission check
game.ReplicatedStorage.Kick.OnServerEvent:Connect(function(actor, target)
  if not RoFlow.hasPermission(actor, "moderation.kick") then return end
  target:Kick("You have been kicked by a moderator.")
  RoFlow.logModAction(actor.UserId, target.UserId, "kick")
end)

-- Modcall
game.ReplicatedStorage.Modcall.OnServerEvent:Connect(function(player, message)
  RoFlow.modcall(player, message)
end)

Available Methods

RoFlow.hasPermission(player, key)booleanCheck if a player has a named permission key
RoFlow.logModAction(actorId, targetId, action, reason?)voidLog a moderation action to the dashboard
RoFlow.modcall(player, message?)voidFire a modcall visible to online staff
RoFlow.sessionStart(player)voidRecord session start (auto-called via PlayerAdded)
RoFlow.sessionEnd(player)voidRecord session end (auto-called via PlayerRemoving)

Ready to install?

Head to your org settings and generate your first API key.

Go to Dashboard