Check out Session messages for how to trigger session commands
LuaAuth provides a macro that allows you to remotely execute functions on a users client
Syntax: la_handle(key: string, func: function)
Params:
| Name | Type | Description |
| key | String | unique idenitifier for the function |
| func | Function | function to run |
Example:
la_handle('send_message', function(data)
print(data.message)
return {
random_thing = 'fr'
}
end)Example request to trigger above function:
const response = await fetch(`https://api.luaauth.com/sessions/{SESSION_ID}/message`, {
headers: { 'Content-Type': 'application/json', token: 'YOUR_API_KEY' },
method: 'POST',
body: JSON.stringify({
key: 'send_message',
data: {
message: 'test'
}
})
});Example response for above request:
{
"success": true,
"processed": true,
"response": {
"random_thing": "fr"
}
}