Custom App Development Guide
5M Phone features a sandboxed, modular application framework that allows developers to create and deploy completely custom third-party applications without modifying core phone files or compromising FiveM Asset Escrow.
Custom apps run inside an isolated iframe container within the phone screen, enjoying hardware-accelerated 60+ FPS performance, native dark/light theme switching, and seamless two-way communication between FiveM Lua scripts and modern web frontends (React, Vue, Svelte, or vanilla HTML/JS).
🚀 Official Starter Template
We provide an official, production-ready developer template built with React 18, TypeScript, Vite, and Tailwind CSS. It includes built-in phone bridge bindings, local browser testing, and sample scripts:
📦 5M_CustomApp — Developer Template
Clone or download the official template repository directly from GitHub to build custom apps in minutes.
⬇️ Download Template (.ZIP) ⭐ GitHub Repository (itzsurajig/5M_CustomApp)
[!TIP] Quick Access Links:
Git Clone Command:
Shellgit clone https://github.com/itzsurajig/5M_CustomApp.git
Why Build Custom Apps on 5M Phone?
- Escrow-Safe & 100% Open: Custom apps live in their own standalone FiveM resource (e.g.
5M_CustomApp). You never need to touch the protected core of5M_Phone. - App Store or Pre-Installed: Configure your app to either be pre-installed on the home screen (
defaultApp = true) or listed in the 5M Phone App Store (defaultApp = false) where players can view screenshots, ratings, and tap "Get". - Local Browser Development: Iterate rapidly in Google Chrome at
http://localhost:5173/using Vite with mock player data — no need to restart FiveM during UI design. - Real-Time Two-Way Bridge:
- Push live game state (GPS coords, player health, vehicle status, job data) from Lua to React via
exports['5M_Phone']:SendAppMessage. - Trigger NUI callbacks from React to Lua via
appFetch. - Smooth gesture navigation: Return to the home screen or lock the phone seamlessly.
- Push live game state (GPS coords, player health, vehicle status, job data) from Lua to React via
- Dynamic Theming: Automatically inherits the player's system dark mode or light mode setting with real-time updates.
4-Step Quick Start
# 1. Clone or download the template into your FiveM resources folder
git clone https://github.com/itzsurajig/5M_CustomApp.git
# 2. Install dependencies & build production UI
cd 5M_CustomApp/ui
npm install
npm run build- Add startup order to your
server.cfg:
ensure 5M_Phone
ensure 5M_CustomApp- Join your server and open 5M Phone — your custom app will appear on the home screen or in the App Store!
Custom App Topics
- Template & Download — Project structure, files, and requirements.
- App Registration & Lifecycle —
RegisterAppexport, metadata, and auto-reconnect. - UI Development & Web Preview — React, Tailwind, Vite HMR, and browser testing.
- Bridge & NUI Communication — Two-way event messaging, callbacks, and close requests.
- App Store & Screenshots — Publishing downloadable apps with screenshots and icon branding.
