Developer guide

How to connect LBPhone to fivehub.pro

Make the photos and videos your players take with the in-game camera upload to your CDN with permanent URLs. Tested on LBPhone 2.8.2.

What you get

LBPhone lets you configure an upload destination for its in-game camera. By default it points at Fivemanage, but it accepts any service of your own through the "Custom" method.

Point it at fivehub.pro and every photo a player takes from their phone uploads to your organization with a permanent URL. No Discord links that expire, no traffic limits, and everything visible in your dashboard so you can moderate.

Step by step

Connect LBPhone in 5 steps

  1. 01

    Generate an organization API key

    Open your fivehub.pro dashboard, go to API Key and create a new one. You need an organization key (it starts with fivehub_org_), not a personal one.

    Copy it somewhere safe: it is shown only once.

  2. 02

    Change the upload method to "Custom"

    In lb-phone/config/config.lua find Config.UploadMethod and set all three lines to "Custom". Without this step LBPhone keeps uploading through Fivemanage and never reads your configuration.

    This is the most commonly missed step, and it fails silently: everything looks fine while photos keep going to the previous service.

  3. 03

    Configure the destination in shared/upload.lua

    Find UploadMethods and edit the Custom entry. That is where the fivehub.pro URL, the form field name and the response paths go.

    The full block is in the code reference below.

  4. 04

    Whitelist the domain

    In lb-phone/config/config.lua add fivehub.pro to both ExternalWhitelistedDomains and UploadWhitelistedDomains.

    They are two separate lists and you need both.

  5. 05

    Load the key in server/apiKeys.lua

    Find the API_KEYS table and put your key in Video, Image and Audio. The same key works for all three.

    Then restart the resource with ensure lb-phone.

UploadMethods = {
    Custom = {
        Video = {
            url = "https://fivehub.pro/api/assets",
            field = "file",
            headers = {
                ["x-api-key"] = "API_KEY",
            },
            success = { path = "publicUrl" },
        },
        Image = {
            url = "https://fivehub.pro/api/assets",
            field = "file",
            headers = {
                ["x-api-key"] = "API_KEY",
            },
            success = { path = "publicUrl" },
        },
        Audio = {
            url = "https://fivehub.pro/api/assets",
            field = "file",
            headers = {
                ["x-api-key"] = "API_KEY",
            },
            success = { path = "publicUrl" },
        },
    },
}
Config.ExternalWhitelistedDomains = {
    "fivemanage.com",
    "fivehub.pro",
}

Config.UploadWhitelistedDomains = {
    "fivemanage.com",
    "fmfile.com",
    "amazonaws.com",
    "fivehub.pro",
}
API_KEYS = {
    Video = "fivehub_org_TU_KEY",
    Image = "fivehub_org_TU_KEY",
    Audio = "fivehub_org_TU_KEY",
}

How to know it worked

With the server running, take a photo from the in-game phone and wait a few seconds.

  • The photo appears in the phone and the server console shows no errors.
  • The asset shows up in your fivehub.pro dashboard, inside the organization, with its permanent URL.
  • Pasting that URL into a browser loads the image.
If something breaks

Common problems

The four failures that come up almost every time, and what causes them.

SymptomCause
The photo does not upload and there is no visible errorConfig.UploadMethod is still not set to "Custom". LBPhone keeps using the previous method and never reaches your configuration.
The console throws a domain-not-allowed errorfivehub.pro is missing from ExternalWhitelistedDomains or from UploadWhitelistedDomains. It has to be in both.
It uploads, but the photo shows up brokenThe API key is a personal key instead of an organization key, or it was copied wrong. It must start with fivehub_org_.
The response says the key is invalidThe key was revoked or expired. Generate a new one in the dashboard and update apiKeys.lua.

FAQ

Do I need a different API key for video, image and audio?

No. A single organization key covers all three. If you revoke it, all three stop together.

What happens if I go over my plan storage?

Overflow is billed per GB. Service is not cut and uploads keep working, so players never notice.

Are player photos private?

URLs are public but unguessable, and every asset appears in your dashboard. You can moderate or delete any content from there.

Does this work on other LBPhone versions?

This guide is tested on 2.8.2. On other versions the file paths may differ, so check they exist before editing.

Technical note

In the example configurations that circulate, the URL includes ?api=API_KEY and an Authorization header. The fivehub.pro server reads neither: it authenticates only through the x-api-key header.

Worth removing them. An API key in a query string ends up in server, proxy and analytics logs, where it can sit exposed without you ever knowing.

Ready to connect your phone?

Create a free account: 20 GB, a native Lua SDK and permanent URLs from minute one.