Custom Apps (SDK)
Add your own apps to the CHERRY Phone, Tablet and CherryBook
Any resource can add its own app to the CHERRY Phone and Tablet. Nothing in vorty-cherry is edited: your resource registers the app with one export and brings its own page. The phone gives it an icon, the opening animation, an optional place in the CHERRY Store, notifications, a badge and a payment sheet.
A complete sample is included: the vorty-cherry-app-template resource, a coffee ordering app called "Brewly". Start it after vorty-cherry, then open CHERRY Store → Brewly → GET or type /brewly. Copy the folder, rename it and make it yours.
- Register the app (server)Lua
local function Register() if GetResourceState('vorty-cherry') ~= 'started' then return end exports['vorty-cherry']:AddApp({ id = 'mytaxi', -- a-z, 0-9, _ (max 24). Not the id of a CHERRY app. name = 'Taxi Pro', ui = 'html/index.html', -- a page of YOUR resource (must be in its fxmanifest `files`) icon = 'taxi.fill', -- an icon name, or a picture of your resource: 'html/icon.png' color = { '#f5c518', '#c98a00' }, -- '#rrggbb', or two colours for a gradient developer = 'Downtown Cab Co.', -- shown on the launch screen (optional) statusBar = 'light', -- white clock over your page; leave out to follow the theme devices = { 'phone', 'tablet' }, -- default: both (the CherryBook counts as a tablet) jobs = { 'taxi' }, -- only these jobs see it; { police = 2 } = from grade 2. Leave out: everyone store = { -- leave out: the app is always on the home screen subtitle = 'Rides for drivers', description = 'Accept rides and see what you earned.', category = 'Travel', }, }) end AddEventHandler('vorty-cherry:apps:ready', Register) -- vorty-cherry was (re)started after your resource CreateThread(Register)AddAppreturnstrue, orfalseand the reason (also printed in the server console). Adddependency 'vorty-cherry'to yourfxmanifest.lua. When your resource stops, its apps leave every phone. - The page
A normal web page. Load the SDK script first:
Code<script src="https://cfx-nui-vorty-cherry/html/sdk/cherry-app.js"></script> <script src="app.js"></script>CodeCherryApp.ready((ctx) => { // ctx = { app, name, resource, device: 'phone' | 'tablet', laptop, dark, locale, me: { name, number }, insets: { top, bottom }, opts } }); CherryApp.nui('getRides', { open: true }).then((res) => { /* ... */ }); // RegisterNUICallback('getRides', ...) of YOUR resource CherryApp.on('message', (data) => { /* ... */ }); // sent from Lua with SendAppMessage CherryApp.on('open', (opts) => { /* ... */ }); // opened again: a notification was tapped, OpenApp(...) CherryApp.on('theme', (dark) => { /* ... */ }); - Talk to the page from Lua
Server:
Luaexports['vorty-cherry']:SendAppMessage(source, 'mytaxi', { type = 'ride', id = 4 }) -- → CherryApp.on('message'); -1 = everyone exports['vorty-cherry']:SetAppBadge(source, 'mytaxi', 2) exports['vorty-cherry']:Notify(source, { app = 'mytaxi', title = 'Taxi Pro', text = 'New ride nearby', open = { ride = 4 } }) exports['vorty-cherry']:RemoveApp('mytaxi')Client:
Luaexports['vorty-cherry']:SendAppMessage('mytaxi', { type = 'ride', id = 4 }) exports['vorty-cherry']:SetAppBadge('mytaxi', 2) exports['vorty-cherry']:OpenApp('mytaxi', { ride = 4 }) -- takes the phone out with the app open ('tablet' as 3rd argument)SendAppMessageonly reaches a player who has the app open at that moment. For everyone else useNotifyandSetAppBadge, and let the page ask for its data when it opens.
SDK calls
Call | What it does |
|---|---|
| Calls your own |
| A notification with your app's icon; |
| A short line at the top of the screen; kind |
| The red number on your icon; |
| The phone's question box; resolves |
| The player picks one of their photos; resolves |
| The player picks a contact; resolves |
| Opens another app of the phone, for example |
|
|
| Back to the home screen |
The script also sets data-theme (light / dark) and data-device (phone / tablet / laptop) on <html>, and the CSS variables --cherry-top / --cherry-bottom (the room the status bar and the home bar need). It pauses walking while the player types in one of your fields and puts the phone away on Escape.
Payments
The amount is decided by your server. The player confirms it on their device (Face Unlock) and CHERRY takes it from their bank account:
local asked, why = exports['vorty-cherry']:RequestPayment(source, {
app = 'mytaxi', amount = 250, title = 'Ride to the airport', text = '4.2 km',
}, function(paid, reason)
if not paid then return end -- reason: 'declined' | 'expired' | 'left'
-- the money has left the player's account: give what was bought, pay the driver or the company...
end)
-- asked = false: why = 'busy' (the player has another request open), 'disabled' or 'player'Never take a price, an amount or a player ID from the page: a player can change anything their own game sends. The page says what is wanted, your server works out what it costs.
Limits are in Config.CustomApps (payments, maxPayment, payTimeout). Every payment is written to the player's Wallet history and to the money Discord log.
Good to know
The game's browser is Chromium 103: no
backdrop-filterinside the phone, no:has(), no container queries.The page can't open pop-ups or
alert()boxes or leave its window. UseCherryApp.confirmandCherryApp.toast.Opened in a normal browser, the SDK answers with empty results and
ready()still fires, so you can design there.An app runs in its own window. It can't read the phone's screens or data and only gets what the calls above return.
Last updated: December 6, 2026