Skip to main content

GIF Setup

RoadPhone ships with a GIF picker in the Messages app (and every other app that supports media attachments), powered by Klipy. All API requests run server-side — the API key never reaches the client.

Quick Start

1

Create a Klipy API key

Sign up at klipy.com (free) and create an API key in your Klipy dashboard.
2

Add the key to API.lua

Open API.lua and replace the placeholder with your key:
API.lua
Cfg.KlipyGifsApiKey = 'your-klipy-api-key-here'
API.lua is server-only. Never move this key into a shared or client script — anything the NUI/client can read can be extracted by players.
3

Restart the resource

Restart RoadPhone (ensure roadphone). The GIF button appears in the Messages chat input automatically.

How it works

NUI (GIF picker) → client callback → server (gifs.lua) → Klipy API
  • The server proxies trending and search requests to Klipy and returns a sanitized item list (URL, width, height only).
  • Trending page 1 is cached in memory for 30 seconds as a rate-limit guard.
  • Results are requested with rating pg-13 and locale en, 24 items per page. These values are fixed in server/gifs.lua — adjust them there if you need a different rating or locale.

Enabling / disabling the feature

The API key is the feature switch:
  • No key configured (empty or the YOUR_KLIPY_API_KEY placeholder) → the server returns empty results and the picker stays empty.
  • Key configured → GIFs are live.
To hide the GIF button in the UI entirely, set the flag in public/static/config/config.json:
public/static/config/config.json
{
  "gifs": false
}

Troubleshooting

  • Check that Cfg.KlipyGifsApiKey in API.lua contains your real key (not the placeholder).
  • Restart the resource after changing API.lua.
  • Check the server console for HTTP errors — the Klipy API must be reachable from your game server (outbound HTTPS).
Make sure "gifs": true is set in public/static/config/config.json and that you deployed a build that includes it.
GIFs are delivered as regular image URLs (.gif). If a media host or proxy re-encodes images, animation can get lost — send the original Klipy URL through unchanged.