Webhooks
Webhooks send events to Discord or your own server as they happen. Available on every plan.
Formats
- Discord: rich embeds with player, executor, place and time.
- HTTP: a JSON POST signed with HMAC-SHA256 in the X-LuaProtect-Signature header.
Events
- connection.join: a player started the script.
- execution.trigger: the protected code started running.
- connection.leave: the player left.
- ban.created and ban.removed.
- script.error: a runtime error was reported.
Verify an HTTP webhook
const sig = crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex');
if (sig !== req.headers['x-luaprotect-signature']) return res.status(401).end();