📱 NPWD Phone Integration

Configure the NPWD Phone resource to upload camera photos to your server.

FiveM • NPWD • Camera

Camera Setup Guide

Follow these steps to enable photo uploads from the NPWD phone camera directly to your self-hosted media server.

1️⃣Media Server Configuration (.env)

On your Media Server, open the .env file and ensure the following are set:

# Your secret API Key (generate one in Settings -> API Key)
API_KEY=jkJpFLuptllYTFQhVrKjE4dvEm2RaLQJ

# The public URL of your media server (NO trailing slash)
# Use http://127.0.0.1:8000 for local testing
APP_URL=http://127.0.0.1:8000
Important: Restart the media server after changing the .env file.

2️⃣FiveM Server Configuration (server.cfg)

Open your FiveM server's server.cfg file and add your API Key as the token:

# NPWD Camera Upload Token
set SCREENSHOT_BASIC_TOKEN "jkJpFLuptllYTFQhVrKjE4dvEm2RaLQJ"

This allows the FiveM server to authenticate with your media server securely.

3️⃣NPWD Resource Configuration (config.json)

Locate the config.json file inside your resources/[npwd]/npwd/ folder.

Find the "images" section and update it exactly as shown below:

"images": {
    "url": "http://127.0.0.1:8000/api/screenshot-upload",
    "type": "imgur",
    "imageEncoding": "webp",
    "contentType": "text/plain",
    "useContentType": true,
    "authorizationHeader": "X-API-Key",
    "authorizationPrefix": "",
    "useAuthorization": true,
    "returnedDataIndexes": ["url"]
},
Note: Replace http://127.0.0.1:8000 with your actual Media Server URL if hosted on a VPS.

Verification

  1. Restart your Media Server.
  2. Restart your FiveM Server (or the npwd resource).
  3. Open the phone in-game, go to the Camera app, and take a photo.
  4. The photo should appear in your Media Server's media_storage folder, and be visible in the phone's gallery.