LB Scripts Integration
To use sCloud with LB-Phone or LB-Tablet, you need to configure the scripts to use custom upload method. If you use both scripts or have multiple FiveM servers, we recommend you to either use different buckets or organize your files in a specific folder.Prerequisites
First, you need to create a bucket if not already done, you can do so by heading to sCloud CDN Dashboard. Use the following details to configure the custom upload method:- Upload URL:
https://cdn.sacul.cloud/YOUR_BUCKET_NAME - Field Name:
file - Headers:
Authorization:Bearer YOUR_API_KEY
Replace
YOUR_BUCKET_NAME and YOUR_API_KEY with your actual sCloud credentials. You can find your API key in your sCloud CDN Dashboard.Configuration
LB-Phone Configuration
To use presigned uploads with LB-Phone, follow these steps:-
Server API Keys & Buckets: Open
lb-phone/server/apiKeys.luaand configure your API keys and bucket names. -
Server Functions: Update
lb-phone/server/custom/functions/functions.luato implement theGetPresignedUrlfunction. -
Shared Upload Config: In
lb-phone/shared/upload.lua, set theurlto"PRESIGNED_URL"for your custom methods. -
Client Functions: Finally, ensure
CustomGetUploadMethodis implemented inlb-phone/client/custom/functions/functions.lua.
LB-Tablet Configuration
Configuration for LB-Tablet is similar to LB-Phone:-
Server API Keys & Buckets: Open
lb-tablet/server/apiKeys.lua. -
Server Functions: Update
lb-tablet/server/custom/functions/functions.luato implementGetPresignedUrl. (The logic is identical to the one in LB-Phone). -
Config Upload: In
lb-tablet/config/upload.lua, seturl = "PRESIGNED_URL". -
Client Functions: Implement
CustomGetUploadMethodinlb-tablet/client/custom/functions/functions.lua.
Legacy Configuration
LB-Phone Configuration
First, open the main LB-Phone configuration file inlb-phone/config/config.lua and scroll down to Config.UploadMethod to set the following values.
lb-phone/shared/upload.lua and replace the default configuration with the following.
LB-Tablet Configuration
First, open the main LB-Tablet configuration file inlb-tablet/config/config.lua and scroll down to Config.UploadMethod to set the following values.
lb-tablet/config/upload.lua and replace the default configuration with the following.
