Docs
APILog inDeploy a serverDeploy

Setting up your scripts

Ready configs for the fxvault resource, the fmsdk shim, lb-phone, npwd, screenshot-basic, qb-phone, ps-camera, RoadPhone Pro, sd-phone and scripts with a Fivemanage address.

Media Storage5 min readUpdated

On this page
  1. The fxvault resource
  2. Scripts built on Fivemanage's SDK (fmsdk)
  3. lb-phone
  4. npwd
  5. Your own scripts (screenshot-basic)
  6. qb-phone
  7. ps-camera
  8. RoadPhone Pro
  9. sd-phone
  10. Scripts with a Fivemanage URL setting

Each config below is the one the panel shows on your team's Setup tab, where your-team is already replaced with your team's name in links. Put an API key wherever a config says YOUR_API_KEY: create one on the API keys tab (see API keys and the API).

A script whose format could not be confirmed from its own published files is left out rather than guessed.

From your serverKey stays on your serverThe script sends the file from your server, with the key in its server files.Your serverfileapi.fxvault.linkUsed bynpwdqb-phonesd-phoneThrough one-time linksKey stays on your serverYour server asks for a link with the key; the player's game posts the file to it.Your serverlinkPlayer's gamefileapi.fxvault.linkUsed bylb-phoneRoadPhone Proyour own scripts (screenshot-basic)Through the fxvault resourceKey stays on your serverCalls to exports.fmsdk reach our fmsdk shim, which hands them to the fxvault resource and its key.Your scriptfmsdk shimfxvault resourcefileapi.fxvault.linkUsed byscripts built on fmsdkKey in players' gamesKey reaches playersThe script sends its token to players' games, which upload with it. Give it a key with Write only, andrevoke it if it leaks.Player's gamefileapi.fxvault.linkUsed byps-cameraFrom your serverKey stays on your serverThe script sends the file from your server,with the key in its server files.Your serverfileapi.fxvault.linkUsed bynpwdqb-phonesd-phoneThrough one-time linksKey stays on your serverYour server asks for a link with the key; theplayer's game posts the file to it.Your serverlinkPlayer's gamefileapi.fxvault.linkUsed bylb-phoneRoadPhone Proyour own scripts (screenshot-basic)Through the fxvault resourceKey stays on your serverCalls to exports.fmsdk reach our fmsdk shim,which hands them to the fxvault resource andits key.Your scriptfmsdk shimfxvault resourcefileapi.fxvault.linkUsed byscripts built on fmsdkKey in players' gamesKey reaches playersThe script sends its token to players' games,which upload with it. Give it a key withWrite only, and revoke it if it leaks.Player's gamefileapi.fxvault.linkUsed byps-camera
The four ways the scripts on this page upload. In three of them the key stays on your server; ps-camera is the one that hands it to players' games, which is why it gets a key with Write only. Derived from the sections on this page.

The fxvault resource

Server-side screenshots and uploads for your own scripts and for the fmsdk shim below. Your key stays on the server; players never see it.

1. Download

Unzip it into your resources folder. It holds two folders: fxvault, and the fmsdk shim.

https://api.fxvault.link/dl/fxvault.zip

2. server.cfg

set, never setr or sets: those send the value to players or to the server list. Then run fxvault status in the server console.

Config
ensure screencapture        # or: ensure screenshot-basic
ensure fxvault
set fxvault:key "YOUR_API_KEY"
# Optional: record who uploaded (license, discord, name). IP addresses are never sent.
# set fxvault:playerIdentifiers "license,discord"

Checked against: docs.fivem.net/docs/scripting-reference/convars/, github.com/itschip/screencapture, github.com/citizenfx/screenshot-basic.

Scripts built on Fivemanage's SDK (fmsdk)

Scripts that call exports.fmsdk keep their screenshots and uploads, now stored here; no script edits. Their log calls are stored in fxvault Logs with resource 1.1.0 or later (the current download) and a key with Send logs; see Send logs from Fivemanage scripts.

server.cfg

Remove Fivemanage's fmsdk folder and put ours (from the same zip) in its place. FIVEMANAGE_MEDIA_API_KEY is no longer read: the key is fxvault:key. For logs, see the link above.

Config
ensure fxvault
ensure fmsdk

Checked against: github.com/fivemanage/sdk.

lb-phone

Uses lb-phone's Custom upload method with one-time links: your server asks for a link with the key, the phone uploads to it, and the key never reaches players.

1Your serverapi.fxvault.linkfunctions.luaapiKeys.luaGetPresignedUrl asks for a one-time linkWith the key from apiKeys.lua, which never leaves your server.2api.fxvault.linkYour serverfunctions.luaThe link comes backRead from data.presignedUrl.3Your serverPlayer's phoneThe phone gets the linkNever the key.4Player's phoneapi.fxvault.linkupload.luaconfig.luaThe phone posts the file to the linkThrough the Custom entry, which config.lua makes the upload method for video, images and audio: fieldfile, and the address back at data.url.5files.fxvault.linkPlayer's phoneconfig.luaThe phone shows the filefxvault.link is on its allowed domains.1Your serverapi.fxvault.linkfunctions.luaapiKeys.luaGetPresignedUrl asks for a one-timelinkWith the key from apiKeys.lua, which neverleaves your server.2api.fxvault.linkYour serverfunctions.luaThe link comes backRead from data.presignedUrl.3Your serverPlayer's phoneThe phone gets the linkNever the key.4Player's phoneapi.fxvault.linkupload.luaconfig.luaThe phone posts the file to the linkThrough the Custom entry, which config.luamakes the upload method for video, images andaudio: field file, and the address back atdata.url.5files.fxvault.linkPlayer's phoneconfig.luaThe phone shows the filefxvault.link is on its allowed domains.
What each of the four lb-phone edits below does when a player's phone uploads. Each step is tagged with the file it comes from: the key is only ever read on your server, and the phone only ever holds the link. Derived from the lb-phone steps below.

1. lb-phone/config/config.lua

Send uploads through the Custom method, and let the phone show files from fxvault.link. Keep the other entries already in each list.

Lua
Config.UploadMethod.Video = "Custom"
Config.UploadMethod.Image = "Custom"
Config.UploadMethod.Audio = "Custom"
 
Config.UploadWhitelistedDomains = {
    "fxvault.link",
}
 
Config.ExternalWhitelistedDomains = {
    "fxvault.link",
}

2. lb-phone/server/apiKeys.lua

The key stays on your server; lb-phone passes it to GetPresignedUrl.

Lua
API_KEYS = {
    Video = "YOUR_API_KEY",
    Image = "YOUR_API_KEY",
    Audio = "YOUR_API_KEY",
}

3. lb-phone/shared/upload.lua

Replace the whole Custom entry inside UploadMethods with this one. It has the same shape as the Fivemanage entry below it.

Lua
    Custom = {
        Default = {
            url = "PRESIGNED_URL",
            field = "file",
            success = {
                path = "data.url"
            },
            sendPlayer = "metadata"
        },
    },

4. lb-phone/server/custom/functions/functions.lua

In GetPresignedUrl, add this branch after the Qbox one, just before the final "end". It asks for a one-time upload link with your key.

Lua
    elseif uploadMethod == "Custom" then
        return Citizen.Await(promise.new(function(p)
            PerformHttpRequest("https://api.fxvault.link/api/v3/file/presigned-url", function(status, body)
                if status ~= 200 then
                    p:resolve()
                    infoprint("error", "Could not get an upload link from fxvault Media (" .. tostring(status) .. ")")
                    return
                end
 
                local data = json.decode(body)
 
                p:resolve(data?.data?.presignedUrl)
            end, "GET", nil, {
                Accept = "application/json",
                Authorization = apiKey
            })
        end))

Checked against: github.com/lbphone/files/blob/main/lb-phone/config/config.lua, github.com/lbphone/files/blob/main/lb-phone/shared/upload.lua, github.com/lbphone/files/blob/main/lb-phone/server/custom/functions/functions.lua, github.com/lbphone/files/blob/main/lb-phone/server/apiKeys.lua.

npwd

npwd uploads from your server, so the key stays there. Point its image upload at fxvault Media and allow the files host.

1. server.cfg

npwd reads the key from this convar.

Config
set SCREENSHOT_BASIC_TOKEN "YOUR_API_KEY"

2. npwd/config.json

Replace the "images" block, and add files.fxvault.link to "safeImageUrls" (keep the hosts already listed: the list is replaced, not merged).

JSON
"images": {
  "url": "https://api.fxvault.link/api/image",
  "type": "image",
  "imageEncoding": "webp",
  "contentType": "multipart/form-data",
  "useContentType": false,
  "authorizationHeader": "Authorization",
  "authorizationPrefix": "",
  "useAuthorization": true,
  "returnedDataIndexes": ["url"]
},
"imageSafety": {
  "safeImageUrls": [
    "files.fxvault.link"
  ]
}

Checked against: github.com/project-error/npwd/blob/master/config.default.json, github.com/project-error/npwd/blob/master/apps/game/server/photo/photo.service.ts.

Your own scripts (screenshot-basic)

For a script of your own: the server asks for a one-time upload link with the key, then the player's game uploads the screenshot to it. Add your own checks (a job, a cooldown) before handing out links.

1. server.cfg

set, not setr: the key stays on the server.

Config
set fxvault_api_key "YOUR_API_KEY"

2. server.lua

Lua
RegisterNetEvent("myscript:uploadLink", function()
    local src = source
    PerformHttpRequest("https://api.fxvault.link/api/v3/file/presigned-url", function(status, body)
        local url = status == 200 and json.decode(body).data.presignedUrl or nil
        TriggerClientEvent("myscript:uploadLink", src, url)
    end, "GET", "", { Authorization = GetConvar("fxvault_api_key", "") })
end)

3. client.lua

Lua
RegisterNetEvent("myscript:uploadLink", function(url)
    if not url then return end
    exports["screenshot-basic"]:requestScreenshotUpload(url, "file", { encoding = "webp" }, function(res)
        local fileUrl = json.decode(res).data.url
        print("Uploaded: " .. fileUrl)
    end)
end)
 
TriggerServerEvent("myscript:uploadLink")

Checked against: github.com/citizenfx/screenshot-basic.

qb-phone

Uses qb-phone's Fivemerr mode, which uploads from your server, so the key stays there.

1. qb-phone/config.lua

Lua
Config.Fivemerr = true

2. qb-phone/server.lua

The two lines at the top of the file.

Lua
local WebHook = 'https://api.fxvault.link/v1/media/images'
local FivemerrApiToken = 'YOUR_API_KEY'

Checked against: github.com/qbcore-framework/qb-phone/blob/main/config.lua, github.com/qbcore-framework/qb-phone/blob/main/server.lua.

ps-camera

ps-camera sends its token to players' games, so create a key with Write only for it and revoke it if it leaks. One address in its client file changes.

1. ps-camera/config.lua

Lua
Config.UseFivemerr = true

2. ps-camera/server/sv_main.lua

In SvConfig.

Lua
FivemerrApiToken = 'YOUR_API_KEY',

3. ps-camera/client/cl_main.lua

Replace the upload address (about line 228). The path stays the same.

https://api.fivemerr.com  →  https://api.fxvault.link

Checked against: github.com/Project-Sloth/ps-camera/blob/main/config.lua, github.com/Project-Sloth/ps-camera/blob/main/server/sv_main.lua, github.com/Project-Sloth/ps-camera/blob/main/client/cl_main.lua.

RoadPhone Pro

Uses RoadPhone Pro's custom upload method with one-time links, so the key stays on your server. Classic RoadPhone only uploads to Fivemanage.

1. roadphone/config.lua

Lua
Config.uploadMethod = 'custom'

2. roadphone/uploader/upload-server.lua

Lua
local APIKey = 'YOUR_API_KEY'
local url = "https://api.fxvault.link/api/v2/presigned-url"

Checked against: docs.roadshop.org/roadphonepro/custom-upload.

sd-phone

sd-phone uploads from your server, so the key stays there. Its Fivemanage address is written into two of its files; change both, and do it again after every sd-phone update, because an update puts them back.

1. sd-phone/configs/server/apikeys.lua

This file stays on your server. The name still says Fivemanage; the key is yours from here.

Lua
FivemanageMedia = 'YOUR_API_KEY',

2. sd-phone/server/photos/uploader.lua

In the UPLOAD_URL line near the top. The path after the address stays the same.

https://api.fivemanage.com  →  https://api.fxvault.link

3. sd-phone/server/photos/presign.lua

In the PRESIGN_URL line near the top. Change it too, so your key can never be sent to Fivemanage.

https://api.fivemanage.com  →  https://api.fxvault.link

4. sd-phone/configs/photos.lua

Keep direct upload off: that mode only works with Fivemanage's own upload links, and with it off every upload passes your server's upload limits first. Add files.fxvault.link to ImportAllowlist, keeping the hosts already there, so players can import images from it.

Lua
Provider = 'fivemanage',
AllowDirectUpload = false,
 
ImportAllowlist = {
    'files.fxvault.link',
},

5. sd-phone/configs/bodycam.lua

One upload can be up to 50 MB, and no larger than your plan's file limit. At sd-phone's default bodycam quality (Bitrate 2500000) that is about two and a half minutes, and sd-phone shows a longer recording only as a failed upload. In the Recording block, cap the length, or lower Bitrate to keep longer ones.

Lua
MaxSeconds = 150,

Checked against: github.com/Samuels-Development/sd-phone/blob/a1ee58d4c3982410e56aa25b31b52e89cca38356/configs/server/apikeys.lua, github.com/Samuels-Development/sd-phone/blob/a1ee58d4c3982410e56aa25b31b52e89cca38356/server/photos/uploader.lua, github.com/Samuels-Development/sd-phone/blob/a1ee58d4c3982410e56aa25b31b52e89cca38356/server/photos/presign.lua, github.com/Samuels-Development/sd-phone/blob/a1ee58d4c3982410e56aa25b31b52e89cca38356/configs/photos.lua, github.com/Samuels-Development/sd-phone/blob/a1ee58d4c3982410e56aa25b31b52e89cca38356/configs/bodycam.lua.

Scripts with a Fivemanage URL setting

fxvault Media answers the same requests as Fivemanage, with your key in the same Authorization header. Where a script lets you set the address, swap it, and allow files.fxvault.link wherever it lists image hosts. Files land in files.fxvault.link/your-team/.

Your script's config

https://api.fivemanage.com  →  https://api.fxvault.link
https://fmapi.net           →  https://api.fxvault.link

Checked against: docs.fivemanage.com.

Need a server, or a hand with one?

Pick a plan to deploy a server, or open a ticket in the panel. Support runs 24/7/365.