SCode StudiosSCodeDocs
Tebex Store

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.

  1. 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)

    AddApp returns true, or false and the reason (also printed in the server console). Add dependency 'vorty-cherry' to your fxmanifest.lua. When your resource stops, its apps leave every phone.

  2. 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>
    Code
    CherryApp.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) => { /* ... */ });
  3. Talk to the page from Lua

    Server:

    Lua
    exports['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:

    Lua
    exports['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)

    SendAppMessage only reaches a player who has the app open at that moment. For everyone else use Notify and SetAppBadge, and let the page ask for its data when it opens.

SDK calls

Call

What it does

CherryApp.nui(event, data)

Calls your own RegisterNUICallback; resolves what cb() was given, null when it failed

CherryApp.notify({ title, text, open })

A notification with your app's icon; open is given to 'open' when it is tapped

CherryApp.toast(text, kind)

A short line at the top of the screen; kind 'success', 'error' or nothing

CherryApp.setBadge(count)

The red number on your icon; 0 clears it

CherryApp.confirm({ title, text, ok, destructive })

The phone's question box; resolves true / false

CherryApp.pickPhoto()

The player picks one of their photos; resolves { id, url } or null

CherryApp.pickContact()

The player picks a contact; resolves { name, number } or null

CherryApp.openApp(id, opts)

Opens another app of the phone, for example 'maps' or 'messages'

CherryApp.setStatusBar(mode)

'light': white clock and icons over your page. 'auto': follow the theme

CherryApp.close()

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:

Lua
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-filter inside the phone, no :has(), no container queries.

  • The page can't open pop-ups or alert() boxes or leave its window. Use CherryApp.confirm and CherryApp.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