Screenshots & screenshot-basic
Capture a player or a report screenshot.
screenshot(source, options, cb): captures a player's screen and uploads it from the player's machine through a presigned URL. Options: folder, encoding (default jpg), quality (default 0.85). Times out after 30 seconds.
lua
exports.basix:screenshot(source, { folder = 'reports' }, function(err, file)
if err then return print('[basix] ' .. err) end
print(file.url, file.id, file.path)
end)From screenshot-basic directly
screenshot-basic. From a server script:
lua
exports['screenshot-basic']:requestClientScreenshotUpload(
source,
'https://upload.basix.media/api/v3/file',
{ headers = { Authorization = 'Bearer ' .. GetConvar('basix_key', '') }, fileName = 'file' },
function(err, data)
print(json.decode(data).url)
end
)Screenshot a player on a report
lua
RegisterCommand('report', function(source, args)
local reason = table.concat(args, ' ')
exports.basix:screenshot(source, { folder = 'reports' }, function(err, file)
exports.basix:warn('Player report', {
player = GetPlayerIdentifierByType(source, 'license'),
metadata = { reason = reason, screenshot = file and file.url or nil, error = err },
})
end)
end)Phone and MDT integrations
If you run a phone or MDT resource, point its own upload setting at BasiX instead of calling exports.basix:screenshot yourself — these already have a built-in "Custom" or S3-style upload method:
Any other script that just needs an upload endpoint: any-script.
Try it on your own server
Create a free account and your API key is ready in about two minutes. 3 GB included, bandwidth never billed, no card needed.