--!strict --- Integration smoke test for Flux **server** SDK (`FluxServer` in ServerScriptService). --- --- Prerequisites (ReplicatedStorage): --- - `FluxShared` ModuleScript (from FluxShared.lua) --- - `FluxRemoteEvent` RemoteEvent (created by `FluxServer.Init`, or create manually in ReplicatedStorage) --- --- Prerequisites (ServerScriptService): --- - `FluxServer` ModuleScript (from FluxServer.lua) --- - This file as a `Script` --- --- - `TEST_API_KEY` replaced with a live `flux_…` key from the Flux project settings. --- - HttpService enabled; allowlist your Flux hostname if HTTP requests are restricted. --- --- On play: expect `Ping` output, then sample server logs in the Flux dashboard. --- --- Optional: fetch from `GET /api/sdk/test-flux` on your Flux host. local TEST_API_KEY = "flux_REPLACE_ME_WITH_YOUR_PROJECT_KEY" local ServerScriptService = game:GetService("ServerScriptService") local FluxServer = require(ServerScriptService.FluxServer) print("[FluxTest] Pinging Flux (GET /api/ping, no API key yet)…") FluxServer.Ping() FluxServer.Init(TEST_API_KEY) FluxServer.Info("Flux test script started", "System", { placeId = tostring(game.PlaceId), jobId = game.JobId, }) FluxServer.Warn("This is a test warning", "Test") FluxServer.Error("This is a test error (not a real failure)", nil, "Test", { ok = true, }) task.defer(function() local players = game:GetService("Players") local p: Player? = players:GetPlayers()[1] if p then FluxServer.Player(p, FluxServer.level.info, "Test log bound to player", "User Action", { userId = p.UserId, }) end end) print("[FluxTest] Queued test logs. Check your Flux dashboard.")