Developer Apps API

Developers can register completely custom third-party NUI applications on the phone home screen without editing the phone resource itself.

[!IMPORTANT] Dedicated Custom App Guide & Starter Template Available: We provide a comprehensive, step-by-step Custom App Development Guide along with an official 5M_CustomApp GitHub Template pre-packaged with React 18, Vite, TypeScript, Tailwind CSS, and live in-game HMR!

⬇️ Download Template (.ZIP) | ⭐ View on GitHub


Registering an App

When Config.DeveloperApps.Enabled = true in configuration/config.lua:

Lua
exports['5M_Phone']:RegisterApp({
    id = 'job-contracts',              -- Unique app identifier
    name = 'Contracts',
    description = 'View freelance job contracts.',
    developer = 'My Studio',
    icon = 'html/icon.png',             -- Path relative to your resource or https:// URL
    ui = 'html/index.html',
    color = '#6366f1',
    defaultApp = false,
    screenshots = { 'html/shot1.png' },
})

Sending Messages to the App NUI

Lua
exports['5M_Phone']:SendAppMessage('job-contracts', 'updateContracts', {
    contracts = {
        { id = 1, title = 'Tow Truck Request', reward = 1500 },
        { id = 2, title = 'Cargo Delivery', reward = 3200 },
    }
})

Unregistering an App

Lua
exports['5M_Phone']:UnregisterApp('job-contracts')