Events & Exports
The phone exposes a public, server-side event bus plus a few stable exports. Everything is additive and best-effort: a handler error never breaks the phone's flow.
Public exports
-- Item handler (registered for you; reference it from your inventory item):
exports['orb-phone']:usePhone(...)
-- Send an email — optionally attaching a money payment delivered to the inbox:
exports['orb-phone']:SendEmail(to, subject, body, opts)
-- Grant / revoke an Orbit (Twitter) verified badge for a number:
exports['orb-phone']:SetTwitterVerified(number, verified)Server event bus
At every key moment the phone fires a server-local TriggerEvent that any resource can listen to with AddEventHandler — no declaration needed:
AddEventHandler('orb-phone:bank:transfer', function(data)
-- data = { from, to, amount, label, timestamp }
end)
AddEventHandler('orb-phone:service:dispatched', function(data)
TriggerEvent('myCad:newCall', data.service, data.coords)
end)Catalog
Payloads are sanitized on purpose — no internal ids, audio blobs or long bodies. Timestamps are ISO-8601 UTC; numbers use XXX-XXX.
Discord webhooks
The same events can post Discord embeds via Config.Webhooks — see Configuration. Off by default; a no-op until URLs are set.
Custom apps
The phone is extensible: NUI ↔ Lua talk through typed message constants (shared/messages.lua ↔ ui/src/shared/messages.ts), with fetchNui (request / response via lib.callback) and SendNUIMessage (push). Server modules validate + scope by owner_number; NUI payloads are validated with Zod. The Maps app (server/places.lua + placesStore.ts) is the reference pattern for a persistent app.