Buildan app
Put your script inside Molo Folio, like housing scripts do with LB Phone. A few lines in your fxmanifest.lua show the app, and a few lines of Lua answer it.
- Needs
- molo_phone 2.4.0+
- You write
- HTML / JS + Lua
- Frameworks
- Any
- Time
- About 10 minutes

How it works
An app is a normal FiveM resource. The phone finds it on its own, shows its icon, and opens its page inside the phone.
- Your
fxmanifest.luadeclares the app Name, icon, colour and the page to open. No Lua is needed to make the icon appear. - Your page is plain HTML and JavaScript It loads the Molo Folio SDK and UI kit, so it looks like the built-in apps, in light and dark mode.
- Your Lua answers the page
RegisterAppCallback('name', fn)on the server (or client), andawait MoloPhone.server('name', data)in the page. That is the whole bridge.
Start from the template. molo_folio_app_template.zip is a complete working app ("My Home": doors, GPS, key sharing). Copy it, rename it, change what you need.
Quick start
3 files- Declare the app in
fxmanifest.luaList your page files infilesso the phone can load them.fx_version 'cerulean' game 'gta5' molo_folio_app 'ui/index.html' molo_folio_app_name 'My Home' molo_folio_app_icon 'ui/icon.png' -- or an emoji: '🏠' molo_folio_app_color '#ff9f0a' -- optional molo_folio_app_description 'Lock your doors and share your keys.' -- optional server_script 'server.lua' files { 'ui/index.html', 'ui/app.js', 'ui/icon.png' } dependency 'molo_phone' - Make the page
Load the UI kit and the SDK from
molo_phone, then write your app.<link rel="stylesheet" href="https://cfx-nui-molo_phone/html/sdk/molo-phone-ui.css"> <script src="https://cfx-nui-molo_phone/html/sdk/molo-phone-sdk.js"></script> <main class="mp-app"> <h1 class="mp-title">My Home</h1> <div class="mp-section">Doors</div> <div class="mp-list" id="doors"></div> </main> <script src="app.js"></script>MoloPhone.onReady(async () => { const doors = await MoloPhone.server('getDoors'); document.querySelector('#doors').innerHTML = doors.map((d) => `<div class="mp-row"><div class="mp-row-main"><div class="mp-row-title">${d.label}</div></div></div>`).join(''); }); - Answer it from your server
Whatever the function returns goes back to the page.
exports.molo_phone:RegisterAppCallback('getDoors', function(source, data, phone) -- source = player id, data = what the page sent, phone.number = '555-1234' return { { id = 1, label = 'Front door' }, { id = 2, label = 'Garage' } } end)
Then add it to server.cfg after the phone and restart:
ensure molo_phone
ensure my_home_appThe icon appears on every phone. Players can remove it or add it back from the App Store, under Third-party apps.
The SDK
molo-phone-sdk.js| Call | What it does |
|---|---|
MoloPhone.onReady(info => …) | Runs when the app opens. info.number, info.name, info.dark, info.lang, info.wide (unfolded), info.folded. |
await MoloPhone.server(name, data) | Calls your server RegisterAppCallback(name, …) and returns its result. |
await MoloPhone.client(name, data) | Calls your client RegisterAppCallback(name, …): waypoints, animations, anything on the player's side. |
MoloPhone.notify(title, text) | Shows a phone notification with your app's icon. |
await MoloPhone.contacts() | The player's contacts: [{ name, number }]. |
await MoloPhone.pickMedia({ video }) | Lets the player pick a photo (or video) from the gallery or the camera. Returns { url }. |
MoloPhone.onMessage(data => …) | Receives what your Lua sends with SendCustomAppMessage (live updates). |
MoloPhone.close() | Goes back to the home screen. |
If a callback does not exist, MoloPhone.server and MoloPhone.client throw an error you can catch, so a typo shows up in the F8 console instead of failing silently.
UI kit
molo-phone-ui.cssThe stylesheet gives your page the phone's fonts, colours and components. Dark mode follows the player's setting on its own.
| Class | Use it for |
|---|---|
mp-app, mp-header, mp-title, mp-subtitle, mp-back | Page, large title, back button |
mp-section, mp-list, mp-row (mp-row-ic, mp-row-main, mp-row-title, mp-row-sub, mp-row-end, mp-chevron) | Grouped lists like the Settings app |
mp-btn + primary / success / danger / block / small, mp-actions | Buttons |
mp-toggle | On/off switch: <label class="mp-toggle"><input type="checkbox"><span></span></label> |
mp-card, mp-grid, mp-badge (green, red, blue) | Cards, tiles, status labels |
mp-input, mp-search, mp-field, mp-label | Forms |
mp-empty, mp-spinner, mp-muted | Empty states and loading |
Colours are CSS variables (--mp-accent, --mp-green, --mp-red, --mp-card…), so you can use them in your own styles.
Example: a housing app
The template is a small housing app. To plug in a real housing or keys script, keep the page and replace the demo data in server.lua with calls to that script.
exports.molo_phone:RegisterAppCallback('setLocked', function(source, data)
-- call your door script here, for example:
exports.ox_doorlock:setDoorState(data.id, data.locked and 1 or 0)
return { ok = true }
end)
exports.molo_phone:RegisterAppCallback('shareKey', function(source, data, phone)
local target = exports.molo_phone:GetSourceFromNumber(data.number)
-- give the key with your keys script here
if target then
exports.molo_phone:SendNotification(target, { title = 'My Home', content = phone.number .. ' gave you a key' })
end
return { ok = true }
end)The same pattern works for a music player for music you made yourself, a job board, a business app, a racing app, and so on.
Lua reference
Server
exports.molo_phone:RegisterAppCallback(name, function(source, data, phone) return result end)
exports.molo_phone:SendNotification(src, { title = '...', content = '...' })
exports.molo_phone:GetPhoneNumber(src)
exports.molo_phone:GetSourceFromNumber('555-1234')Client
exports.molo_phone:RegisterAppCallback(name, function(data) return result end)
exports.molo_phone:SendCustomAppMessage('my_home_app', { type = 'refresh' }) -- MoloPhone.onMessage in the page
exports.molo_phone:IsOpen()Adding the app from Lua instead of the fxmanifest
Useful if the app should only appear for some players (a job, an item…). Paths are relative to your resource.
exports.molo_phone:AddCustomApp({ id = 'my_home_app', name = 'My Home', icon = 'ui/icon.png', ui = 'ui/index.html' })
exports.molo_phone:RemoveCustomApp('my_home_app')With the fxmanifest method, the app id is your resource name.
Tips
- Test in a browser first. Open your
ui/index.htmldirectly: the layout works, and the SDK calls simply wait for the phone. - Every file the page loads must be in
files { }, otherwise it does not load in game. - Restart order. Restarting your app resource is always fine. If you restart
molo_phoneitself, restart your app afterwards so its callbacks are registered again. - Icons. A square PNG (256×256) with a transparent background looks best on the coloured tile. An emoji works too.
- Unfolded phone.
info.wideis true when your app is shown full width on the unfolded phone, if you want a two-column layout. - Selling your app? It is your resource: you can escrow it and sell it on its own. Tell your buyers it needs Molo Folio 2.4.0 or newer.