Docs FiveM Integration Companion Resource Setup

Companion Resource Setup

5 min read

The Blaze Companion Resource is a small FiveM resource that connects your game server to your Blaze Sites website.


What it does

  • Sends live server status (online/offline, player count, uptime) to your site every 30 seconds
  • Broadcasts player list with optional character names and jobs
  • Listens for custom events you define and sends them to your site in real time
  • Provides an API endpoint for the whitelist system

Installation

Download

In your Blaze Sites dashboard: Settings → FiveM Integration → Download Resource.

This downloads blaze-companion.zip.

Extract

Extract to your server's resources directory:

server/
└── resources/
    └── blaze-companion/
        ├── fxmanifest.lua
        ├── config.lua
        └── server/
            ├── main.lua
            └── events.lua

Configure

Open blaze-companion/config.lua:

Config = {}

-- Your site credentials (from Settings → FiveM Integration)
Config.ApiKey  = "blz_live_your_api_key_here"
Config.SiteUrl = "https://yourserver.blazesites.net"

-- What to share with your site
Config.UpdateInterval   = 30     -- seconds between status updates
Config.ShowPlayerList   = true   -- show online players on your site
Config.ShowPlayerJobs   = true   -- show character jobs (QBCore/ESX)
Config.ShowCharNames    = true   -- show character names
Config.ShowGangData     = false  -- show gang/faction membership
Config.ShowEconomy      = false  -- economy data (uses extra DB queries)

-- Framework (auto-detected if left as "auto")
Config.Framework = "auto"  -- "auto" | "qbcore" | "esx" | "none"

Add to server.cfg

ensure blaze-companion

Add this line after your framework resource (QBCore or ESX) to ensure it loads after.

Verify

Restart your server. Check your Blaze Sites dashboard — you should see:

● FiveM Connected
Last ping: just now
Framework: QBCore detected
Players: 0/64

Sending custom events to your site

Any resource on your server can broadcast events to your Blaze Sites website using the companion's export:

-- In any server-side script:
exports['blaze-companion']:BroadcastEvent('myEvent:name', {
    player = GetPlayerName(source),
    action = "arrested",
    location = "Vinewood",
})

These events can be received by the Custom Event Node in the visual node editor on your site.


Security

Your API key is a secret — treat it like a password.

  • Never commit it to a public GitHub repository
  • Never share it in Discord or forums
  • If exposed, regenerate it immediately from Settings → FiveM Integration → Regenerate Key

The companion uses HTTPS for all communication. All requests are signed with your API key in the x-api-key header.


Uninstalling

Remove ensure blaze-companion from your server.cfg and delete the blaze-companion folder. Disconnect the server in your Blaze Sites dashboard under Settings → FiveM Integration → Disconnect.