Tutorial 2026-03-12

How to Create Custom Apps for Agency Phone

TDYSKY

TDYSKY

Founder & Lead Developer at Agency Scripts

Agency Phone App Architecture

Agency Phone is designed with extensibility in mind, allowing server developers to create custom apps that integrate seamlessly with the phone interface. Each app runs as a self-contained module with its own HTML, CSS, and JavaScript, communicating with the phone framework through a well-defined API. This architecture means you can build anything from a racing app to a real estate manager to a custom dispatch system, all accessible from the phone that players already know how to use.

Setting Up Your App Structure

To create a custom app, start by creating a new folder inside the Agency Phone apps directory. Your app needs an app.json manifest file that defines the app name, icon, description, and entry point. The manifest also specifies permissions your app requires, such as access to contacts, notifications, or GPS data. Create your main HTML file referenced in the manifest, along with any CSS and JavaScript files your app needs. The phone framework automatically discovers and registers apps that follow this structure.

Using the App API

The Agency Phone exposes a JavaScript API that your app can use to interact with phone features. Call AgencyPhone.getContacts() to access the player contact list, AgencyPhone.sendNotification() to push notifications, or AgencyPhone.getPlayerData() to retrieve the current player information from the framework. The API also provides navigation methods to switch between app screens, a storage API for persisting app-specific data, and event hooks for lifecycle management like when your app is opened, minimized, or closed.

Connecting to Server-Side Logic

Most custom apps need to communicate with server-side scripts for data persistence and secure operations. Use the phone NUI callback system to send requests from your app JavaScript to a Lua server script. Register your server-side handlers in a companion resource that depends on Agency Phone, process the requests with proper validation, and return the results. This separation ensures that your app logic runs securely on the server while the UI remains responsive on the client.

Styling Your App

Agency Phone provides CSS variables and utility classes that match the phone theme, so your custom app can look consistent with built-in apps. Use the provided color variables for backgrounds, text, and accents to ensure your app adapts to light and dark themes automatically. The phone container handles scrolling, sizing, and safe area insets, so focus your CSS on the content layout within the app viewport. Test your app across different phone frame sizes to ensure it looks good on all resolutions.

Publishing and Distribution

Once your app is complete, package it as a standalone resource that depends on Agency Phone. Include clear installation instructions, configuration options, and example screenshots in your documentation. If you plan to sell your app on Tebex, ensure it follows the escrow guidelines and include a demo video showing the app in action. Consider offering a free basic version with premium features to attract more server owners and build trust in your development work before committing to a purchase.

Share this article

Ready to upgrade your server?

Check out our premium FiveM scripts in the Agency Scripts store or join our Discord community for support and updates.