Get Turn Credentials
Generate temporary TURN credentials for WebRTC clients using the authenticated community API key.
Query Parameters
Name
Type
Required
Description
Example Request
-- luarocks install sonoran.lua
-- For SonoranCADFiveM in-game usage, see the SonoranCADFiveM tab for the export-based client.
local Sonoran = require("sonoran")
local sonoran = Sonoran.createClient({
product = Sonoran.productEnums.CAD,
communityId = "YOUR_COMMUNITY_ID",
apiKey = "YOUR_API_KEY",
defaultServerId = 1
})
local response = sonoran.cad:getTurnCredentialsV2({
userId = "unit-1"
})
print(response.success)
print(response.data and response.data.ttl)local cad = exports["sonorancad"]:getCadClient()const cad = exports["sonorancad"].getCadClient();// dotnet add package Sonoran.Net
using CitizenFX.Core.Native;
using Sonoran;
var communityId = API.GetConvar("sonoran_communityID", "");
var apiKey = API.GetConvar("sonoran_apiKey", "");
var serverIdRaw = API.GetConvar("sonoran_serverId", "1");
var serverId = int.TryParse(serverIdRaw, out var parsedServerId) ? parsedServerId : 1;
using var sonoran = new SonoranClient(new SonoranClientOptions
{
product = SonoranProduct.CAD,
communityId = communityId,
apiKey = apiKey,
defaultServerId = serverId
});Response
Last updated
Was this helpful?

