Skip to main content
Use FiveMesh CDN with LB-Phone or LB-Tablet by configuring a custom upload method. Use presigned uploads so the script can upload phone or tablet media without exposing your FiveMesh service key to clients.
If you use both LB-Phone and LB-Tablet, give each script its own CDN path prefix such as /phone and /tablet. You can restrict service keys to those prefixes from the FiveMesh dashboard.

Prerequisites

Before you begin, confirm:
  • FiveMesh CDN is set up for the active workspace.
  • You have a service key with CDN write access.
  • The service key is scoped to the path prefixes the script should manage.
  • You can edit the LB-Phone or LB-Tablet server files.
Use these values while configuring the integration:
Do not configure direct uploads with a permanent API key in client-visible files. Keep the service key in server-side LB-Scripts files and return presigned upload URLs to the client.

LB-Phone configuration

To use presigned uploads with LB-Phone, update the server and upload configuration.
1

Configure server credentials

Open lb-phone/server/apiKeys.lua and configure the API keys and target path prefixes.
2

Request a presigned upload URL

Update lb-phone/server/custom/functions/functions.lua to implement GetPresignedUrl.
3

Use presigned URLs in upload settings

In lb-phone/shared/upload.lua, set url to "PRESIGNED_URL" for custom methods.
4

Return the custom method

Confirm CustomGetUploadMethod exists in lb-phone/client/custom/functions/functions.lua.

LB-Tablet configuration

LB-Tablet uses the same presigned upload pattern.
1

Configure server credentials

Open lb-tablet/server/apiKeys.lua and add the same API_KEYS and UPLOAD_PATHS values.
2

Request a presigned upload URL

Update lb-tablet/server/custom/functions/functions.lua with the same GetPresignedUrl function used for LB-Phone.
3

Use presigned URLs in upload settings

In lb-tablet/config/upload.lua, set url = "PRESIGNED_URL" for each custom media type.
4

Return the custom method

Confirm CustomGetUploadMethod is implemented in lb-tablet/client/custom/functions/functions.lua.