# Create Presigned Upload URL
Source: https://docs.fivemanage.com/api-reference/files/create-presigned-upload-url
/openapi.json get /v3/file/presigned-url
Generate a presigned URL for file upload in V3. This URL allows uploading a file directly without using an API token in the final POST.
# Delete File
Source: https://docs.fivemanage.com/api-reference/files/delete-file
/openapi.json delete /v3/file/{path}
Delete a specific file by ID or storage key.
# List All Files
Source: https://docs.fivemanage.com/api-reference/files/list-all-files
/openapi.json get /v3/file
List files with pagination and filtering by type or path.
If a custom CDN domain is configured and enabled, the response `url` will use the custom domain and `originalUrl` will contain the default storage URL.
# Retrieve File Metadata
Source: https://docs.fivemanage.com/api-reference/files/retrieve-file-metadata
/openapi.json get /v3/file/{path}
Get detailed information about a specific file by ID or storage key.
If a custom CDN domain is configured and enabled, the response `url` will use the custom domain and `originalUrl` will contain the default storage URL.
# Upload File (Base64)
Source: https://docs.fivemanage.com/api-reference/files/upload-file-base64
/openapi.json post /v3/file/base64
Upload a base64 encoded file with optional metadata and path. Supports images, videos, and audio.
If a custom CDN domain is configured and enabled, the response `url` will use the custom domain and `originalUrl` will contain the default storage URL.
# Upload File (Multipart)
Source: https://docs.fivemanage.com/api-reference/files/upload-file-multipart
/openapi.json post /v3/file
Upload a file using multipart/form-data with optional metadata and path. Supports images, videos, and audio.
If a custom CDN domain is configured and enabled, the response `url` will use the custom domain and `originalUrl` will contain the default storage URL.
# Upload File via Presigned URL
Source: https://docs.fivemanage.com/api-reference/files/upload-file-via-presigned-url
/openapi.json post /v3/file/presigned-url/{token}
Upload a file using a V3 presigned URL token. Supports all standard V3 upload fields in form-data.
If a custom CDN domain is configured and enabled, the response `url` will use the custom domain and `originalUrl` will contain the default storage URL.
# API Introduction
Source: https://docs.fivemanage.com/api-reference/introduction
Build powerful integrations with the Fivemanage REST API.
Welcome to the Fivemanage API reference. Our REST API allows you to programmatically manage your game media, centralize your logs, and integrate our high-performance infrastructure directly into your own applications and game scripts.
## Base URL
All API requests should be made to the following base URL:
```http theme={null}
https://api.fivemanage.com/api/v3
```
## Authentication
The Fivemanage API uses API Keys to authenticate requests. You can generate and manage your API keys from the [Tokens](https://app.fivemanage.com?to=/dashboard/:teamId/token) page in your dashboard.
To authenticate a request, include your API key in the `Authorization` header:
```http theme={null}
Authorization: YOUR_API_KEY
```
Your API keys carry significant privileges. Keep them secure and never share them in publicly accessible areas such as GitHub or client-side code.
## Core Features
Our API is organized around the following core functionalities:
Upload, list, and delete images, videos, and audio files. Manage your game's assets with ease.
Submit logs from your game servers to a centralized, searchable dashboard.
Generate secure, temporary URLs for direct client-side uploads to our CDN.
Manage SDK tokens and heartbeats for seamless integration with FiveM and Roblox.
## Response Formats
The API returns data in JSON format. Successful requests will typically return a `200 OK` or `201 Created` status code, while errors will return a descriptive error message and an appropriate HTTP status code (e.g., `400 Bad Request`, `401 Unauthorized`).
```json theme={null}
{
"status": "ok",
"data": {
"id": "7F9pGhN8qwErT1vx5aZk",
"url": "https://r2.fivemanage.com//7F9pGhN8qwErT1vx5aZk.jpg"
}
}
```
# Get Log by Trace ID
Source: https://docs.fivemanage.com/api-reference/logging/get-log-by-trace-id
/openapi.json get /v3/logs/{traceId}
Retrieve a single log entry by its trace ID.
# Ingest Logs
Source: https://docs.fivemanage.com/api-reference/logging/ingest-logs
/openapi.json post /v3/logs
Submit one or more log entries to the logging system.
# Query Logs
Source: https://docs.fivemanage.com/api-reference/logging/query-logs
/openapi.json get /v3/logs
Search and list log entries with filtering and pagination.
# Migrate from V2
Source: https://docs.fivemanage.com/api-reference/migrate-from-v2
Learn how to migrate from API V2 to V3
This guide outlines the changes and steps required to migrate your application from the V2 API to the V3 API. The V3 API introduces a more unified file handling system and improved logging capabilities.
## File API
The file upload API has been consolidated into a single endpoint, replacing the media-specific endpoints in V2.
### Endpoint Changes
| Feature | V2 Endpoint | V3 Endpoint |
| :----------------------- | :---------------------------------- | :--------------------------------------- |
| Image Upload | `POST /api/v2/image` | `POST /api/v3/file` |
| Video Upload | `POST /api/v2/video` | `POST /api/v3/file` |
| Audio Upload | `POST /api/v2/audio` | `POST /api/v3/file` |
| Base64 Upload | N/A | `POST /api/v3/file/base64` |
| Presigned URL (Generate) | `GET /api/v2/presigned-url` | `GET /api/v3/file/presigned-url` |
| Presigned URL (Upload) | `POST /api/v2/presigned-url/:token` | `POST /api/v3/file/presigned-url/:token` |
### Request Changes
In V3, the form field for the file content is always `file`, regardless of the media type.
#### Multipart Upload
**V2 Request:**
```bash theme={null}
curl -X POST https://api.fivemanage.com/api/v2/image \
-H "Authorization: YOUR_API_TOKEN" \
-F "image=@/path/to/image.png"
```
**V3 Request:**
```bash theme={null}
curl -X POST https://api.fivemanage.com/api/v3/file \
-H "Authorization: YOUR_API_TOKEN" \
-F "file=@/path/to/image.png"
```
**New Optional Fields in V3:**
* `filename`: Custom filename for the uploaded file.
* `path`: Directory path to store the file (e.g., `users/avatars`).
* `metadata`: JSON string containing metadata.
* `retentionExempt`: Boolean to exempt the file from retention policies.
#### Base64 Upload
V3 introduces a dedicated endpoint for Base64 encoded files.
**Request Body:**
```json theme={null}
{
"base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"filename": "image.png",
"path": "uploads",
"metadata": "{\"userId\": \"123\"}",
"retentionExempt": false
}
```
### Response Format
The response structure remains consistent, returning the file ID and URL.
```json theme={null}
{
"data": {
"id": "file_123456789",
"url": "https://r2.fivemanage.com/..."
}
}
```
## Presigned URL
Presigned URLs allow you to generate a temporary upload URL that can be used without exposing your API token. This is useful for client-side uploads.
### Generating a Presigned URL
**V2 Request:**
```bash theme={null}
curl -X GET "https://api.fivemanage.com/api/v2/presigned-url?fileType=image&expiresAt=1700000000" \
-H "Authorization: YOUR_API_TOKEN"
```
**V3 Request:**
```bash theme={null}
curl -X GET "https://api.fivemanage.com/api/v3/file/presigned-url?expiresAt=1700000000" \
-H "Authorization: YOUR_API_TOKEN"
```
**Key Differences:**
* V2 **requires** the `fileType` query parameter (`image`, `video`, or `audio`).
* V3 **does not require** `fileType` since the unified `/file` endpoint handles all media types.
* Default expiration: V2 defaults to 5 minutes, V3 defaults to 15 minutes.
### Uploading via Presigned URL
**V2 Request:**
```bash theme={null}
curl -X POST "https://api.fivemanage.com/api/v2/presigned-url/YOUR_TOKEN" \
-F "image=@/path/to/image.png"
```
**V3 Request:**
```bash theme={null}
curl -X POST "https://api.fivemanage.com/api/v3/file/presigned-url/YOUR_TOKEN" \
-F "file=@/path/to/image.png"
```
**Key Differences:**
* V2 requires the form field to match the `fileType` specified when generating the URL (`image`, `video`, or `audio`).
* V3 always uses `file` as the form field name.
* V3 supports additional optional fields: `filename`, `path`, `metadata`, and `retentionExempt`.
## Logs API
The logs API has been moved to the V3 namespace and now enforces batch processing.
### Endpoint Changes
| Feature | V2 Endpoint | V3 Endpoint |
| :---------- | :--------------- | :------------------ |
| Ingest Logs | `POST /api/logs` | `POST /api/v3/logs` |
### Request Changes
The V3 Logs API **requires** an array of log objects. Single log objects are no longer supported as the root element.
**V2 Request (Deprecated):**
```bash theme={null}
curl -X POST https://api.fivemanage.com/api/logs \
-H "Authorization: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"level": "info",
"message": "User logged in",
"resource": "auth-service"
}'
```
**V3 Request (Required):**
```bash theme={null}
curl -X POST https://api.fivemanage.com/api/v3/logs \
-H "Authorization: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '[
{
"level": "info",
"message": "User logged in",
"resource": "auth-service"
}
]'
```
### Response Format
The response format remains the same:
```json theme={null}
{
"status": "ok"
}
```
# Authorize SDK Session
Source: https://docs.fivemanage.com/api-reference/sdk-integration/authorize-sdk-session
/openapi.json post /sdk/report
Generate an SDK token to establish a reporting session. Required for game server integrations.
# Refresh SDK Session
Source: https://docs.fivemanage.com/api-reference/sdk-integration/refresh-sdk-session
/openapi.json post /sdk/heartbeat
Send a heartbeat to maintain an active SDK reporting session and extend token validity.
# Terminate SDK Session
Source: https://docs.fivemanage.com/api-reference/sdk-integration/terminate-sdk-session
/openapi.json post /sdk/invalidate
Manually invalidate an SDK session and its associated token.
# Configuration
Source: https://docs.fivemanage.com/fivem-sdk/configuration
Detailed explanation of the configuration options available in the Fivemanage SDK.
The Fivemanage SDK can be configured using both FiveM ConVars and a `config.json` file.
## API Keys (ConVars)
API keys are sensitive and should be set in your `server.cfg` using ConVars. This prevents them from being accidentally shared if you share your resource files.
| ConVar | Description | Required For |
| -------------------------- | ------------------------------ | --------------------- |
| `FIVEMANAGE_MEDIA_API_KEY` | Your Fivemanage Media API key. | Images, Videos, Audio |
| `FIVEMANAGE_LOGS_API_KEY` | Your Fivemanage Logs API key. | Cloud Logging |
```cfg theme={null}
set FIVEMANAGE_MEDIA_API_KEY "your_media_api_key"
set FIVEMANAGE_LOGS_API_KEY "your_logs_api_key"
```
## config.json
The `config.json` file located in the `fmsdk` folder allows you to customize the behavior of the logging system and automatic events.
### Logging Settings
| Property | Type | Default | Description |
| -------------------------------- | ---------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| `logs.level` | `string` | `"info"` | The minimum log level to capture. Must be one of the levels defined in `logs.levels`. |
| `logs.levels` | `string[]` | `["error", "warn", "info", "debug"]` | Defines the hierarchy of log levels. |
| `logs.console` | `boolean` | `true` | Whether to print logs to the server console. |
| `logs.enableCloudLogging` | `boolean` | `true` | Whether to send logs to the Fivemanage cloud. |
| `logs.appendPlayerIdentifiers` | `boolean` | `true` | Automatically append player identifiers (license, discord, etc.) to logs when `playerSource` is provided. |
| `logs.excludedPlayerIdentifiers` | `string[]` | `["ip"]` | List of identifier types to exclude from logs for privacy. |
| `logs.excludeInDepthMetadata` | `boolean` | `false` | If true, excludes some internal metadata like server session IDs. |
### Automatic Events
The SDK can automatically log certain server events to specific datasets.
| Property | Description |
| ------------------------ | ---------------------------------------------------------- |
| `logs.playerEvents` | Logs player connections and disconnections. |
| `logs.chatEvents` | Logs all chat messages (can result in high log volume). |
| `logs.baseEvents` | Logs base events like `onResourceStart`, `onResourceStop`. |
| `logs.txAdminEvents` | Logs actions performed via txAdmin. |
| `logs.oxInventoryEvents` | Logs inventory actions if using `ox_inventory`. |
Each event category has the following structure:
```json theme={null}
"playerEvents": {
"enabled": false,
"dataset": "default"
}
```
* `enabled`: Set to `true` to enable automatic logging for this category.
* `dataset`: The name of the dataset in Fivemanage where these logs should be sent.
## Example config.json
```json theme={null}
{
"$schema": "./config.schema.json",
"logs": {
"level": "info",
"levels": ["error", "warn", "info", "debug"],
"console": true,
"enableCloudLogging": true,
"appendPlayerIdentifiers": true,
"excludedPlayerIdentifiers": ["ip"],
"excludeInDepthMetadata": false,
"playerEvents": {
"enabled": true,
"dataset": "connections"
},
"chatEvents": {
"enabled": false,
"dataset": "chat"
},
"oxInventoryEvents": {
"enabled": true,
"dataset": "inventory"
}
}
}
```
# Images
Source: https://docs.fivemanage.com/fivem-sdk/images
Learn how to capture and upload images using the Fivemanage SDK.
The Fivemanage SDK provides easy-to-use exports for capturing screenshots from players and uploading them to the cloud.
## Client-Side Exports
### `takeImage`
Captures a screenshot of the player's screen and uploads it to Fivemanage.
**Definition:**
```typescript theme={null}
takeImage(metadata?: Record): Promise<{ url: string }>
```
**Usage:**
```lua Lua theme={null}
local imageData = exports.fmsdk:takeImage({
name = "Player Screenshot",
description = "Captured via script"
})
if imageData then
print("Image uploaded to: " .. imageData.url)
end
```
```javascript JavaScript theme={null}
exports.fmsdk.takeImage({
name: "Player Screenshot",
description: "Captured via script"
}).then((imageData) => {
console.log("Image uploaded to: " + imageData.url);
}).catch((err) => {
console.error("Failed to take image: " + err);
});
```
***
## Server-Side Exports
### `takeServerImage`
Requests a screenshot from a specific player and uploads it.
**Definition:**
```typescript theme={null}
takeServerImage(
playerSource: string | number,
metadata?: Record,
timeout?: number
): Promise<{ url: string }>
```
**Usage:**
```lua Lua theme={null}
local playerSource = 1
local success, imageData = pcall(function()
return exports.fmsdk:takeServerImage(playerSource, {
reason = "Admin investigation"
}, 10000) -- 10 second timeout
end)
if success then
print("Image uploaded: " .. imageData.url)
else
print("Failed to capture image: " .. imageData)
end
```
```javascript JavaScript theme={null}
const playerSource = 1;
exports.fmsdk.takeServerImage(playerSource, {
reason: "Admin investigation"
}, 10000).then((imageData) => {
console.log("Image uploaded: " + imageData.url);
}).catch((err) => {
console.error("Failed to capture image: " + err);
});
```
### `uploadImage`
Uploads an image from a buffer directly from the server.
**Definition:**
```typescript theme={null}
uploadImage(
buffer: ArrayBuffer,
options: { metadata?: Record; fileName?: string }
): Promise<{ url: string }>
```
**Usage:**
```lua Lua theme={null}
-- Example: Uploading a file read from the server (requires appropriate permissions/tools)
-- Note: Lua doesn't handle buffers as easily as JS, this is typically used in JS/TS.
```
```javascript JavaScript theme={null}
const fs = require('fs');
const path = require('path');
const filePath = path.join(GetResourcePath(GetCurrentResourceName()), 'image.png');
const buffer = fs.readFileSync(filePath);
exports.fmsdk.uploadImage(buffer, {
fileName: "server_file.png",
metadata: { source: "server_filesystem" }
}).then((imageData) => {
console.log("Uploaded: " + imageData.url);
});
```
## Metadata
You can attach custom metadata to any image upload. This metadata is searchable and viewable in the Fivemanage dashboard.
Common metadata fields:
* `name`: A title for the image.
* `description`: A longer description.
* `playerSource`: If provided, the SDK can automatically link the image to a player.
# Installation
Source: https://docs.fivemanage.com/fivem-sdk/installation
Learn how to install and set up the Fivemanage SDK on your FiveM server.
## Prerequisites
Before installing the SDK, ensure you have the following:
* A Fivemanage account and API keys (Media and Logs).
* **[screenshot-basic](https://github.com/citizenfx/screenshot-basic)**: Required for capturing client screenshots.
## Installation Steps
Obtain the latest release of the Fivemanage SDK from the [GitHub releases page](https://github.com/fivemanage/sdk/releases/latest). Download the `fmsdk.zip` file.
Unzip the `fmsdk.zip` and place the `fmsdk` folder into your FiveM server's `resources` directory.
Ensure the folder is named `fmsdk` and is placed directly in the `resources` folder. FMSDK does not support category folders.
If you don't have `screenshot-basic` installed, download it and add it to your `resources` folder. This is essential for the `takeImage` functionality.
Add the following lines to your `server.cfg`. Ensure `screenshot-basic` starts **before** `fmsdk`.
```cfg theme={null}
ensure screenshot-basic
ensure fmsdk
```
Add your Fivemanage API keys as ConVars in your `server.cfg`:
```cfg theme={null}
set FIVEMANAGE_MEDIA_API_KEY "your_media_api_key"
set FIVEMANAGE_LOGS_API_KEY "your_logs_api_key"
```
You only need to set the keys for the features you plan to use.
## Configuration
After installation, you can further customize the SDK's behavior by editing the `config.json` file located within the `fmsdk` resource folder.
Explore all available configuration options in config.json.
# Introduction
Source: https://docs.fivemanage.com/fivem-sdk/introduction
The Fivemanage SDK for FiveM simplifies interaction with our public API, providing straightforward access to image, video, audio, and log hosting services.
The Fivemanage SDK is a powerful tool designed for FiveM server developers. It streamlines the process of integrating cloud-based media hosting and logging into your server, allowing you to focus on building great gameplay experiences.
## Key Features
Capture screenshots from clients and upload them directly to Fivemanage.
Send server logs to a centralized dashboard with automatic player identifier tracking.
Generate secure, temporary URLs for uploading media directly from the client or server.
Optionally log common server events like player connections, chat messages, and txAdmin actions automatically.
## Why use the SDK?
* **Simplicity**: Easy-to-use exports for both Lua and JavaScript/TypeScript.
* **Performance**: Built with performance in mind, using asynchronous operations to avoid blocking the main server thread.
* **Security**: Securely handle API keys using FiveM ConVars.
* **Insights**: Gain better visibility into your server's activity with structured logging and media management.
## Next Steps
Ready to get started? Follow our installation guide to set up the SDK on your server.
Learn how to install and configure the Fivemanage SDK.
# Logs
Source: https://docs.fivemanage.com/fivem-sdk/logs
Centralize your server logs with the Fivemanage SDK.
The Fivemanage SDK provides a robust logging system that can send logs to the Fivemanage cloud, print them to the console, and automatically include player identifiers.
## Server-Side Exports
### `Log`
The primary export for sending logs to a specific dataset.
**Definition:**
```typescript theme={null}
Log(
datasetId: string,
level: string,
message: string,
metadata?: {
playerSource?: string | number,
targetSource?: string | number,
[key: string]: unknown
}
): void
```
**Usage:**
```lua Lua theme={null}
exports.fmsdk:Log("economy", "info", "Player purchased an item", {
playerSource = source,
item = "Pistol",
price = 500
})
```
```javascript JavaScript theme={null}
exports.fmsdk.Log("economy", "info", "Player purchased an item", {
playerSource: source,
item: "Pistol",
price: 500
});
```
### Shorthand Exports
For convenience, the SDK provides shorthands for common log levels. These always send to the specified dataset.
* `Info(datasetId, message, metadata)`
* `Warn(datasetId, message, metadata)`
* `Error(datasetId, message, metadata)`
**Usage:**
```lua theme={null}
exports.fmsdk:Info("default", "Server started successfully")
exports.fmsdk:Error("anticheat", "Suspicious activity detected", { playerSource = source })
```
### `LogMessage`
A legacy/shorthand export that sends logs to the `"default"` dataset.
```lua theme={null}
exports.fmsdk:LogMessage("info", "This goes to the default dataset")
```
***
## Datasets
Datasets allow you to categorize your logs in the Fivemanage dashboard. You can create different datasets for different purposes, such as `economy`, `anticheat`, `admin_actions`, etc.
If a dataset name is provided that doesn't exist, it will be created automatically (depending on your Fivemanage plan/settings).
***
## Automatic Player Identifiers
When you include `playerSource` or `targetSource` in the metadata, the SDK automatically fetches and appends player identifiers (License, Discord, Steam, etc.) to the log entry.
This makes it incredibly easy to track actions back to specific players without manually gathering identifiers every time.
```lua theme={null}
exports.fmsdk:Log("kills", "info", "Player killed another player", {
playerSource = killerSource,
targetSource = victimSource,
weapon = "CombatPistol"
})
```
***
## Automatic Event Logging
The SDK can be configured to automatically log common FiveM events. This is managed in the `config.json` file.
Supported automatic events:
* **Player Events**: Connections, disconnections.
* **Chat Events**: All chat messages.
* **Base Events**: Resource starts/stops.
* **txAdmin Events**: Admin actions.
* **ox\_inventory**: Item movements, purchases, etc. (if installed).
See the [Configuration](/fivem-sdk/configuration) page for how to enable these.
# Presigned URLs
Source: https://docs.fivemanage.com/fivem-sdk/presigned-urls
Generate secure, temporary URLs for direct media uploads.
Presigned URLs allow you to grant temporary permission to upload a file directly to Fivemanage without sharing your API key with the client.
## Server-Side Export
### `requestPresignedUrl`
Requests a presigned URL from the Fivemanage API.
**Definition:**
```typescript theme={null}
requestPresignedUrl(fileType: "image" | "audio" | "video"): Promise
```
**Usage:**
```lua Lua theme={null}
local presignedUrl = exports.fmsdk:requestPresignedUrl("image")
if presignedUrl then
print("Generated presigned URL: " .. presignedUrl)
-- You can now send this URL to a client to perform a direct upload
end
```
```javascript JavaScript theme={null}
exports.fmsdk.requestPresignedUrl("video").then((url) => {
console.log("Generated presigned URL: " + url);
}).catch((err) => {
console.error("Failed to get presigned URL: " + err);
});
```
## How it works
1. **Server Request**: Your server script calls `requestPresignedUrl`.
2. **API Response**: Fivemanage returns a unique, time-limited URL.
3. **Client Upload**: Your server sends this URL to the client (e.g., via a NUI callback or client event).
4. **Direct Upload**: The client performs an HTTP PUT or POST request to that URL with the file data.
This approach is more efficient for large files (like videos or high-quality audio) as the data doesn't need to pass through your FiveM server.
## Example: Client-side Upload (Conceptual)
**Server:**
```lua theme={null}
RegisterNetEvent('myResource:getUploadUrl', function()
local src = source
local url = exports.fmsdk:requestPresignedUrl("image")
TriggerClientEvent('myResource:receiveUploadUrl', src, url)
end)
```
**Client (NUI/JS):**
```javascript theme={null}
// After receiving the URL from the server
async function uploadFile(url, fileBlob) {
const response = await fetch(url, {
method: 'PUT',
body: fileBlob,
headers: {
'Content-Type': 'image/png'
}
});
if (response.ok) {
console.log("Upload successful!");
}
}
```
# Deleting files
Source: https://docs.fivemanage.com/fivemanage/guides/dashboard/storage/deleting-files
Learn how to remove individual files or perform mass deletions from your storage.
Fivemanage provides several ways to delete files, ranging from individual removal to bulk mass deletion based on date ranges.
**Deletion is Permanent** Deleting files from Fivemanage is irreversible. Once confirmed, the file and its associated data are permanently removed from our servers and cannot be recovered.
## Individual Deletion
If you only need to remove a few specific files, you can do so directly from the storage list or grid view.
In the **Storage** dashboard, use the checkboxes next to the files you want to remove.
The **Delete** button will appear at the top of the list once at least one item is selected.
A confirmation dialog will appear. Click **Confirm Delete** to permanently remove the selected items.
## Mass Deletion (Danger Zone)
For large-scale cleanup, Fivemanage offers a powerful **Mass Delete** tool in the Danger Zone. This is useful for clearing out months of old data that is no longer needed.
Mass deletion requires **Owner** permissions for the team.
### How to use Mass Delete
Go to **Storage** > **Danger Zone** in your dashboard.
Choose which types of media you want to target (Images, Videos, or Audio). You can select one or all of them.
Select the start and end dates for the files you want to delete. The system will calculate how many files match your criteria.
To prevent accidental deletion, you must confirm the total count of files before the process begins.
## Important Considerations
### Retention Exempt Files
Files marked as **Retention Exempt** will still be deleted if you manually select them for deletion or if they fall within a Mass Deletion date range. Exemption only protects files from *automatic* cleanup policies.
### Bulk Selection Tips
* Use the **Search** bar to find specific groups of files (e.g., by extension or filename) before selecting them for deletion.
* You can filter by **Media Type** to quickly select all videos or all audio files in the current view.
Learn how to set up automatic retention policies so you don't have to delete files manually.
# Storage Settings
Source: https://docs.fivemanage.com/fivemanage/guides/dashboard/storage/settings
Configure automatic retention policies and media quality for your team's storage.
Storage settings allow you to automate the lifecycle of your media assets and optimize how images are stored and served. These settings apply globally to your team but can be overridden for specific files.
## Accessing Settings
To manage your storage configuration:
Navigate to the **Storage** section from your dashboard sidebar.
Click on the **Settings** tab located in the storage navigation bar.
## Retention Policies
Retention policies help you manage storage costs and comply with data privacy requirements by automatically deleting old files.
### Configuration Options
You can enable or disable retention individually for different media types:
* **Images:** Photos, screenshots, and UI assets.
* **Videos:** Gameplay clips, recordings, and tutorials.
* **Audio:** Voice recordings and sound effects.
### Retention Periods
For each enabled type, you can choose how long files should be kept before automatic deletion:
* 7 days
* 30 days
* 90 days
* 180 days
* 365 days
**Pro-tip:** Use shorter retention periods for temporary assets like bug report screenshots to keep your storage clean.
**Automatic Deletion is Permanent** Once a file is deleted by the retention policy, it cannot be recovered. Ensure you use [Retention Exemption](/fivemanage/guides/dashboard/storage/upload-files#retention-exemption) for critical assets.
## Image Quality Settings
Fivemanage allows you to optimize image storage by adjusting the compression level. This is particularly useful for reducing bandwidth usage and improving load times for your end-users.
### Quality Levels
When **Override Image Quality** is enabled, you can set the compression level from **10%** (highest compression, smallest size) to **100%** (lowest compression, original quality).
* **Recommended (50% - 80%):** A good balance between visual clarity and file size.
* **High Performance (10% - 40%):** Best for large-scale applications where load speed is critical and perfect detail is less important.
Quality settings only apply to images uploaded *after* the setting is changed. Existing images will remain at their original quality.
## Saving Changes
After adjusting your settings, click the **Save Changes** button at the bottom of the form. A notification will confirm that your team's configuration has been updated.
Find out how to protect individual files from being deleted by your global retention policies.
# Upload files
Source: https://docs.fivemanage.com/fivemanage/guides/dashboard/storage/upload-files
Learn how to upload images, videos, and audio files to Fivemanage and manage their retention settings.
Fivemanage provides a robust storage system designed for high-performance media hosting. You can upload images, videos, and audio files directly through the dashboard with support for large files and automatic retention policies.
## How to upload files
Follow these steps to upload media to your team's storage:
Open your [Dashboard](https://fivemanage.com/dashboard) and select **Storage** from the sidebar menu.
Click the **Upload** button located at the top right of the storage interface.
You can either click the dashed area to open your file browser or simply drag and drop your files directly into the dialog.
Fivemanage supports images, videos, and audio files up to **1GB** per file.
If you want specific files to be kept permanently regardless of your team's auto-deletion policies, check the **Retention Exempt** box.
Files marked as **Retention Exempt** will never be automatically deleted by the system.
Click **Upload All** to begin the process. You can monitor the progress of each file individually. Once finished, you'll receive a notification and the files will appear in your storage list.
## Retention Exemption
By default, Fivemanage may automatically delete older files based on your team's retention settings to help manage storage and costs.
### Why use Retention Exemption?
* **Permanent Assets:** For logos, UI elements, or critical evidence that must never be deleted.
* **Specific Overrides:** Allows you to keep individual files even if your general policy is set to 7 or 30 days.
When a file is marked as exempt, it displays a badge in the dashboard to indicate it will be skipped during automatic cleanup.
## Retention Policies & Quality
You can manage your global retention policies in the **Storage Settings** tab.
* **Per-type Retention:** Set different expiration periods for images, videos, and audio.
* **Image Quality:** Optionally override image quality to optimize for storage space or performance.
## Supported File Types
| Category | Supported Formats | Max Size |
| :--------- | :------------------------- | :------- |
| **Images** | PNG, JPEG, GIF, WebP, etc. | 1 GB |
| **Videos** | MP4, WebM, MOV, etc. | 1 GB |
| **Audio** | MP3, WAV, OGG, etc. | 1 GB |
# Manage team members
Source: https://docs.fivemanage.com/fivemanage/guides/dashboard/team/manage-members
Learn how to invite new members to your team and manage existing ones.
Collaboration is at the heart of Fivemanage. You can easily invite your colleagues to your team and manage their access levels as your organization grows.
You must be a team **Owner** or **Admin** to invite or remove members.
## Inviting New Members
Inviting a new member is simple and only requires their email address.
Navigate to **Settings** > **Manage Team** in the sidebar.
Click the **Invite Member** button at the top of the members list.
Enter the email address of the person you want to invite and click **Send Invitation**.
### What happens next?
1. An invitation email is sent to the recipient.
2. The user will appear in your member list as **Pending** until they accept the invitation.
3. Once they accept, they will have default **Member** access (which you can then upgrade to Admin or Developer).
## Managing Existing Members
From the management dashboard, you can see all active and pending members of your team.
### Updating Roles
To change a member's role or customize their permissions, click the **Settings** (gear icon) next to their name. For a full breakdown of what each role can do, see our [Roles & Permissions](/fivemanage/guides/dashboard/team/roles) guide.
### Removing Members
If a team member no longer needs access:
1. Click the **Settings** (gear icon) next to their name.
2. Select **Remove from Team**.
3. Confirm the action in the popup dialog.
Removing a member is immediate. They will lose access to all team resources, including logs, storage, and API tokens.
## Managing Invitations
If you accidentally sent an invitation to the wrong email or the person is no longer joining your team, you can revoke the invite.
1. Find the pending invitation in the member list.
2. Click the **Revoke** button next to their email.
3. The invitation link will immediately become invalid.
Learn about the different roles and what each team member can access.
# Team Roles & Permissions
Source: https://docs.fivemanage.com/fivemanage/guides/dashboard/team/roles
Understand the different access levels and permissions available for team members in Fivemanage.
Fivemanage uses a role-based access control (RBAC) system to ensure your team members have the appropriate level of access to your resources. Each role comes with a set of default permissions that can be further customized.
## Role Overview
| Role | Description | Best For |
| :------------ | :----------------------------------------------------- | :------------------------------------ |
| **Owner** | Full control over the team, billing, and all settings. | Team creators and organization leads. |
| **Admin** | High-level management access for members and settings. | Managers and team leads. |
| **Developer** | Access to technical resources like logs and tokens. | Software engineers and developers. |
| **Member** | Basic view-only access to the dashboard. | Staff, observers or new team members. |
## Detailed Role Breakdown
The **Owner** role has absolute authority over the team.
**Capabilities:**
* Manage billing and subscriptions.
* Change the team name and delete the team.
* Invite, remove, and change roles for all members (including Admins).
* Full access to all API tokens, logs, and integrations.
* Access to the Danger Zone for mass deletion.
**Admins** can manage day-to-day operations and team settings.
**Capabilities:**
* Invite new members and manage pending invitations.
* Update roles for Developer and Member roles.
* Configure storage settings and retention policies.
* Create and manage API tokens.
* Modify integrations (Discord, etc.).
**Developers** focus on the technical implementation and monitoring.
**Capabilities:**
* View and copy API tokens (read-only by default).
* Access and search through logs.
* View storage assets and folders.
* Cannot change organizational settings or billing.
**Members** have minimal access, primarily for viewing data.
**Capabilities:**
* View the storage dashboard and assets.
* View basic team information.
* No management permissions by default.
## Customizing Permissions
While roles provide a starting point, Owners and Admins can fine-tune permissions for individual members.
### Permission Categories
* **Logs:** Control whether a user can read or search team logs.
* **Tokens:** Granular control over reading existing tokens or creating new ones.
* **Integrations:** Permission to modify external connections like Discord bots and webhooks.
**Note on Inheritance:** When you change a member's role, their permissions are automatically updated to the default for that new role. You can then manually toggle specific permissions if needed.
## How to Change a Role
Navigate to **Settings** > **Manage Team** in your dashboard.
Find the member in the list and click the **Settings** (gear icon) next to their name.
Select the new role from the dropdown menu and click **Save Changes**.
Only the **Owner** can transfer ownership or remove other Owners. Admins cannot change the role of an Owner.
# Best practices
Source: https://docs.fivemanage.com/fivemanage/guides/logs/best-practices
Learn how to effectively use Fivemanage logging with the REST API and SDKs.
Effective logging is crucial for monitoring your game server's health, debugging issues, and understanding player behavior. Fivemanage provides a robust logging system accessible via a REST API and various SDKs. This guide covers best practices for logging, including code examples for the FiveM SDK, the REST API, and the Hytale SDK.
## General Best Practices
Regardless of the platform or SDK you use, following these best practices ensures your logs are useful and performant.
### 1. Use Structured Logging
Avoid simple string concatenation for log messages. Instead, use structured logging (JSON) to include key-value pairs. This allows for powerful filtering and querying later.
**Bad:**
```text theme={null}
Player 123 joined the server.
```
**Good:**
```json theme={null}
{
"level": "info",
"message": "Player joined the server",
"metadata": {
"playerId": "123",
"playerName": "JohnDoe",
"ip": "192.168.1.1"
}
}
```
### 2. Include Contextual Metadata
Always include relevant metadata in your logs. This context is invaluable when troubleshooting. Common metadata fields include:
* **User ID / Player ID**: Who triggered the event?
* **Resource Name**: Which script or module generated the log?
* **Request ID / Trace ID**: For tracing requests across services.
* **Environment**: e.g., `production`, `development`.
### 3. Use Appropriate Log Levels
Use standard log levels to categorize the severity of events:
* **Debug**: Detailed information for debugging purposes.
* **Info**: General operational events (e.g., startup, shutdown, player join).
* **Warn**: Potential issues that don't stop the application (e.g., deprecated API usage).
* **Error**: Errors that affect functionality but don't crash the server.
* **Fatal**: Critical errors that cause the server to crash.
### 4. Batch Logs
Sending logs one by one can impact performance. Batch logs together and send them in intervals (e.g., every 5 seconds or when 50 logs are accumulated). The Fivemanage API supports batch ingestion.
### 5. Use Datasets
Organize your logs into datasets using the `X-Fivemanage-Dataset` header. This helps separate logs from different environments (e.g., `production`, `staging`) or different game servers.
***
## REST API
The Fivemanage REST API is the most flexible way to send logs. It can be used from any language or platform that supports HTTP requests.
### Endpoint
`POST https://api.fivemanage.com/api/v3/logs`
### Authentication
Include your API token in the `Authorization` header.
### Request Body
The body should be a JSON array of log objects.
### Example (cURL)
```bash theme={null}
curl -X POST https://api.fivemanage.com/api/v3/logs \
-H "Authorization: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "X-Fivemanage-Dataset: production" \
-d '[
{
"level": "info",
"message": "Server started successfully",
"resource": "core",
"metadata": {
"version": "1.0.0",
"port": 30120
}
},
{
"level": "error",
"message": "Database connection failed",
"resource": "database",
"metadata": {
"error": "Connection timeout",
"retryCount": 3
}
}
]'
```
***
## FiveM SDK
The FiveM SDK simplifies logging from your FiveM server resources. It handles authentication and batching automatically.
### Installation
Ensure you have the `fivemanage` resource installed and configured with your API token.
### Usage (Lua)
```lua theme={null}
-- Log an info message
exports.fivemanage:log("info", "Player spawned", {
playerId = source,
model = "mp_m_freemode_01",
coords = GetEntityCoords(GetPlayerPed(source))
})
-- Log an error
exports.fivemanage:log("error", "Failed to save player data", {
playerId = source,
error = "Database timeout"
})
```
### Best Practices for FiveM
* **Resource Name**: The SDK automatically includes the resource name. Ensure your resource names are descriptive.
* **Player Identifiers**: When logging player actions, include their identifiers (license, steam, discord) in the metadata for easier tracking.
* **Event Handling**: Log critical server events like resource starts/stops and player connections/disconnections.
***
## Hytale SDK
For Hytale servers (Java/Kotlin), you can use the Fivemanage SDK or make direct HTTP requests.
### Usage (Java/Kotlin)
Assuming a hypothetical `FivemanageLogger` class wrapper:
```kotlin theme={null}
import com.fivemanage.sdk.FivemanageLogger
val logger = FivemanageLogger("YOUR_API_TOKEN")
// Log an info message
logger.info("Player joined the adventure", mapOf(
"playerUuid" to player.uniqueId.toString(),
"world" to player.world.name
))
// Log an error with exception
try {
// ... risky code ...
} catch (e: Exception) {
logger.error("An error occurred", mapOf(
"exception" to e.message,
"stackTrace" to e.stackTraceToString()
))
}
```
### Best Practices for Hytale
* **World Context**: Include the world name or dimension in metadata.
* **Entity Data**: Log entity types and locations for gameplay analysis.
* **Performance**: Use asynchronous logging to avoid blocking the main server thread.
***
## OpenTelemetry Integration
Fivemanage supports OpenTelemetry standards. While the current API focuses on structured logs, you can include trace context in your metadata to link logs with traces.
### Including Trace Context
If you are using OpenTelemetry in your application, extract the `trace_id` and `span_id` and include them in the `metadata` field.
```json theme={null}
{
"level": "error",
"message": "Payment failed",
"metadata": {
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"span_id": "00f067aa0ba902b7",
"userId": "user_123"
}
}
```
This allows you to correlate logs with distributed traces, providing a complete picture of a request's lifecycle.
# Game integrations
Source: https://docs.fivemanage.com/fivemanage/guides/logs/game-integrations
# Getting started
Source: https://docs.fivemanage.com/fivemanage/guides/logs/getting-started
# 0Bug Report System
Source: https://docs.fivemanage.com/guides/integration/bug-report-system
Learn how to integrate 0Bug Report System with Fivemanage.
To configure 0Bug Report System with Fivemanage, follow the video tutorial below.
# CodeM Phone
Source: https://docs.fivemanage.com/guides/integration/codem-phone
Learn how to integrate CodeM Phone with Fivemanage.
To configure CodeM Phone with Fivemanage, follow the video tutorial below.
# JPR Phone System
Source: https://docs.fivemanage.com/guides/integration/jpr-phone
Learn how to integrate JPR Phone System with Fivemanage.
The author of JPR Phone System has created a video tutorial on how to integrate their script with Fivemanage services.
# LB Phone
Source: https://docs.fivemanage.com/guides/integration/lb-phone
This requires LB-Phone v1.5.0 or higher
## Configuring
First open `lb-phone/config/config.lua` and set all upload methods to `Fivemanage`
```lua lb-phone/config/config.lua theme={null}
Config.UploadMethod.Video = "Fivemanage"
Config.UploadMethod.Image = "Fivemanage"
Config.UploadMethod.Audio = "Fivemanage"
```
Now set the API token you got from Fivemanage in `lb-phone/server/apiKeys.lua`
```lua lb-phone/server/apiKeys.lua theme={null}
API_KEYS = {
Video = "YOUR_TOKEN",
Image = "YOUR_TOKEN",
Audio = "YOUR_TOKEN",
}
```
# nPhone
Source: https://docs.fivemanage.com/guides/integration/nphone
Learn how to integrate nPhone with Fivemanage.
To integrate nPhone with Fivemanage, follow these steps:
1. Open `nPhone/config/apiKeys_s.lua`
2. Set `Config_WEBHOOKS.MediaUploadMethod` to `fivemanage`
3. Set your **Fivemanage** API key in `Config_WEBHOOKS.APIKey`
# Quasar Smartphone
Source: https://docs.fivemanage.com/guides/integration/quasar-smartphone
Learn how to integrate Quasar Smartphone / Smartphone Pro with Fivemanage.
This requires Quasar Smartphone >= 2.8.2 or Quasar Smartphone Pro >= 1.1.6
### Configuring
To configure Quasar Smartphone with Fivemanage, follow the video tutorial below.
# RX ReportsPRO
Source: https://docs.fivemanage.com/guides/integration/reports-pro
Learn how to integrate RX ReportsPRO with Fivemanage for screenshots.
To make screenshots work, you must configure the script. Currently, we only support Fivemanage for saving and retrieving screenshots.
### FiveManage Setup
1. Create an account at [fivemanage.com](https://fivemanage.com/)
2. Go to **Tokens** and select **Create new token**
3. Choose **Images only** as the token type and give it a name.
### Script Configuration
1. Copy your token and open `RxReportsPRO/config/sv_config.lua`
2. Scroll to the bottom and paste your token in `Config.FIVEMANAGE_API_KEY`:
```lua RxReportsPRO/config/sv_config.lua theme={null}
Config.FIVEMANAGE_API_KEY = 'your_token_here'
```
# ShareX
Source: https://docs.fivemanage.com/guides/integration/sharex
Learn how to configure ShareX as a custom uploader for Fivemanage.
To configure ShareX to upload directly to Fivemanage, follow these steps:
### Configuring
1. Open the ShareX main application.
2. Navigate to **Custom Uploader Settings**.
3. Create a **New** uploader.
4. Set the name to `Fivemanage`.
5. Set the **Request URL** to `https://api.fivemanage.com/api/v2/image`.
6. Add a header: **Name** `Authorization`, **Value** `Your_Api_Key`.
7. Set the **File Form Name** to `image`.
8. Set the **URL** to `{json:data.url}`.
9. Change your destination to **Custom Image Uploader**.
# TGIANN
Source: https://docs.fivemanage.com/guides/integration/tgiann
Learn how to integrate TGIANN scripts with Fivemanage.
To integrate TGIANN scripts with Fivemanage, follow these steps:
1. Open `tgiann-core\configs\screenshotConfig.lua`
2. Set `screenshot.fivemManage.active` to `true`
3. Set your **Fivemanage** API key in `screenshot.fivemManage.api`
```lua tgiann-core\configs\screenshotConfig.lua theme={null}
screenshot = {
fivemanage = { -- https://fivemanage.com
active = true, -- Set to true to enable Fivemanage
api = 'YOUR_API_KEY', -- Fivemanage API Key
},
discordWebhook = "" -- If 'fivemanage' is active, this will be ignored
}
```
For more information, visit the [TGIANN Documentation](https://docs.tgiann.com/).
# YSeries | YFlip | YPhone
Source: https://docs.fivemanage.com/guides/integration/yseries
Learn how to integrate YSeries scripts with Fivemanage.
This requires YSeries | YFlip | YPhone 0.10.0 or higher.
### Configuring
You can find detailed instructions on configuring the camera for YSeries, YFlip, and YPhone in the official [TeamsGG Documentation](https://docs.teamsgg.dev/paid-scripts/phone/configure#camera).
# First steps
Source: https://docs.fivemanage.com/guides/uploading-files/first-steps
Follow this guide to start uploading files
Before you can start using the Upload API, you need to create an account and get an API key. You can do this by signing up at [Fivemanage ](https://www.fivemanage.com/) and creating a team.
Login to your account and go to the tokens page in the [dashboard ](https://app.fivemanage.com?to=/dashboard/:teamId/token).
Create a new token by clicking the “Create token” button. There are a few different types of tokens. If you wish to uplaod all kinds of media, you can choose `Media`. You will use this token to authenticate with the API.
# Images
Source: https://docs.fivemanage.com/guides/uploading-files/images
Upload images through the Fivemanage API
## Uploading an image
If you wish to upload an image to the Upload API, you can do so by sending a POST request to the [https://api.fivemanage.com/api/v3/file](https://api.fivemanage.com/api/v3/file) endpoint.
### General
#### Headers
You need to send an `Authorization` header with your API key.
#### Query parameters
You can also send your API key as a query parameter `?apiKey=`. This is useful if you are using the Upload API in a browser.
#### Body
The body of the request should be a form-data object with a file named `file` .
### Uploading an image with Axios
```js theme={null}
const axios = require('axios');
const fs = require('fs');
const apiKey = 'YOUR_API_TOKEN';
const url = 'https://api.fivemanage.com/api/v3/file';
const formData = new FormData();
formData.append('file', fs.createReadStream('image.png'));
// Optional metadata field (JSON string)
formData.append("metadata", JSON.stringify({
name: 'My image',
description: 'This is my image',
}));
// Custom filename and path
formData.append("filename", "cool_image.png")
// if a folder does not exist, it will be created automatically
formData.append("path", "path/to/folder")
axios.post(url, formData, {
headers: {
Authorization: apiKey,
}
}).then(res => {
console.log(res.data.url);
}).catch(err => {
console.error(err);
});
```
### Uploading a base64 image
If you have a base64 encoded image, you can upload it using the `/v3/file/base64` endpoint. This is particularly useful for environments where `FormData` is not available or difficult to use, such as some game engines or server-side scripts.
```js theme={null}
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
const url = 'https://api.fivemanage.com/api/v3/file/base64';
const data = {
base64: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
filename: "pixel.png",
// Optional metadata field (JSON string)
metadata: JSON.stringify({
name: 'My image',
description: 'This is my image',
})
};
axios.post(url, data, {
headers: {
Authorization: apiKey,
'Content-Type': 'application/json'
}
}).then(res => {
console.log(res.data.url);
}).catch(err => {
console.error(err);
});
```
#### Response
##### Success
```json theme={null}
{
"data": {
// use this ID when you want to delete or get a file later
"id": "7F9pGhN8qwErT1vx5aZk",
"url": "https://r2.fivemanage.com/6E9pGhN8qwErT1vx5aZk/7F9pGhN8qwErT1vx5aZk.webp"
},
"status": "ok"
}
```
### Deleting a file
When we want to delete an image, we can do so by sending a DELETE request to the [https://api.fivemanage.com/api/v3/file/:path](https://r2.fivemanage.com/api/v3/file/:path) endpoint.
The `:path` parameter should be the ID or the file path of the image you want to delete. You can get the ID from the response when you upload an image (see above).
```js theme={null}
import axios from "axios";
const options = {
method: 'DELETE',
url: 'https://api.fivemanage.com/api/v3/file/0987654321',
headers: {
Authorization: 'YOUR_API_TOKEN'
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
```
### Listing images
You can list your uploaded images using a GET request. You can filter by type to only see images.
```js theme={null}
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
// Filter by type=image
const url = 'https://api.fivemanage.com/api/v3/file?type=image';
axios.get(url, {
headers: { Authorization: apiKey }
}).then(res => {
console.log(res.data);
}).catch(err => {
console.error(err);
});
```
### Getting image details
To get details about a specific image, including its metadata, use the GET request with the file ID.
```js theme={null}
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
const fileId = '7F9pGhN8qwErT1vx5aZk';
const url = `https://api.fivemanage.com/api/v3/file/${fileId}`;
axios.get(url, {
headers: { Authorization: apiKey }
}).then(res => {
console.log(res.data);
}).catch(err => {
console.error(err);
});
```
### Games & Mods
#### FiveM
You can upload files from Lua using the base64 endpoint.
You can upload an image using the base64 endpoint directly from Lua.
```lua theme={null}
local apiKey = "YOUR_API_TOKEN"
local url = "https://api.fivemanage.com/api/v3/file/base64"
local base64Image = "data:image/png;base64,..." -- Your base64 string
PerformHttpRequest(url, function(statusCode, text, headers)
local data = json.decode(text)
if data then
print("Uploaded: " .. data.data.url)
else
print("Error: " .. text)
end
end, 'POST', json.encode({
base64 = base64Image,
filename = "image.png"
}), {
["Content-Type"] = "application/json",
["Authorization"] = apiKey
})
```
There are a few ways to upload an image to the Image API. The easiest way is to use [Screenshot Basic](https://github.com/citizenfx/screenshot-basic).
#### Screenshot Basic
##### Using headers
```lua theme={null}
exports['screenshot-basic']:requestScreenshotUpload('https://api.fivemanage.com/api/v3/file',
'file',
{
headers = {
Authorization = "YOUR_API_TOKEN"
}
},
function(data)
local resp = json.decode(data)
if resp then
-- the url is in resp.data.url
print(resp.data.url)
end
end)
```
##### Using query parameters
```lua theme={null}
exports['screenshot-basic']:requestScreenshotUpload('https://api.fivemanage.com/api/v3/file?apiKey=YOUR_API_TOKEN', 'file', function(data)
local resp = json.decode(data)
if resp then
print(resp.data.url)
end
end)
```
# Presigned URLs
Source: https://docs.fivemanage.com/guides/uploading-files/presigned-urls
Presigned URLs is the safest way to upload files through the client. One example is from NUI in FiveM, where you otherwise would expose the token to every client if you're not using a presigned URL, or uploading your files from the server.
To get a presigned URL, you first need to request for it. Here we'll go through how you'd do it
Start by performing a `GET` request on the server. This needs to contain the endpoint and your API token.
```bash theme={null}
curl --request GET \
--url 'https://api.fivemanage.com/api/v3/file/presigned-url' \
--header 'Authorization: YOUR_API_TOKEN' \
```
You will then get a response that looks like this:
```json theme={null}
{
"data": {
"presignedUrl": "https://api.fivemanage.com/api/v3/file/presigned-url/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
},
"status": "ok"
}
```
This is the url that you will be using in order to upload the file.
```javascript theme={null}
const options = {
method: 'GET',
headers: {
'User-Agent': 'YOUR_SERVICE',
Authorization: 'YOUR_API_TOKEN'
}
};
fetch('https://api.fivemanage.com/api/v3/file/presigned-url', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
```
```http theme={null}
curl --request POST \
--url https://api.fivemanage.com/api/v3/file/presigned-url/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... \
--header 'Content-Type: multipart/form-data' \
--form file=path/to/your/file.png
```
### Response
The response you get back is like any other file upload using the other uploads API endpoints.
```json theme={null}
{
"data": {
"id": "7F9pGhN8qwErT1vx5aZk",
"url": "https://r2.fivemanage.com/6E9pGhN8qwErT1vx5aZk/7F9pGhN8qwErT1vx5aZk.jpg"
},
"status": "ok"
}
```
```javascript theme={null}
const axios = require('axios');
const fs = require('fs');
// this is the URL you got from the server-side.
const url = 'https://api.fivemanage.com/api/v3/file/presigned-url/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
const formData = new FormData();
formData.append('file', fs.createReadStream('image.png'));
// Optional metadata field (JSON string)
formData.append("metadata", JSON.stringify({
name: 'My image',
description: 'This is my image',
}));
axios.post(url, formData).then(res => {
console.log(res.data.url);
}).catch(err => {
console.error(err);
});
```
When using Presigned URLs, you mainly uploads file on the client side or from a UI/NUI.
# Videos
Source: https://docs.fivemanage.com/guides/uploading-files/videos
How to upload videos through our API.
## Uploading videos
### Getting started
In order to send vidoes to the Upload API, you can do so by sending a POST request to the [https://api.fivemanage.com/api/v3/file](https://api.fivemanage.com/api/v3/file) endpoint.
To upload video, simply submit a form with a form field called `file` with your video as value. As well as metadata.
### Uploading a video
```js theme={null}
const axios = require('axios');
const fs = require('fs');
const apiKey = 'YOUR_API_TOKEN';
const url = 'https://api.fivemanage.com/api/v3/file';
const formData = new FormData();
formData.append('file', yourVideoBlob);
// Optional metadata field (JSON string)
formData.append("metadata", JSON.stringify({
name: 'My video',
description: 'This is a video of something cool",
// or any other field
}));
axios.post(url, formData, {
headers: {
Authorization: apiKey,
}
}).then(res => {
console.log(res.data.url);
}).catch(err => {
console.error(err);
});
```
#### Response
##### Success
```json theme={null}
{
"data": {
"id": "7F9pGhN8qwErT1vx5aZk",
"url": "https://r2.fivemanage.com/6E9pGhN8qwErT1vx5aZk/7F9pGhN8qwErT1vx5aZk.mp4"
},
"status": "ok"
}
```
### Deleting a video
When we want to delete a video, we can do so by sending a DELETE request to the [https://api.fivemanage.com/api/v3/file/:path ](https://api.fivemanage.com/api/v3/file/:path)endpoint.
The `:id` parameter should be the ID of the video you want to delete. You can get the ID from the response when you upload a video (see above).
```js theme={null}
import axios from "axios";
const options = {
method: 'DELETE',
url: 'http://api.fivemanage.com/api/v3/file/0987654321',
headers: {
Authorization: 'YOUR_API_TOKEN'
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
})
```
### Listing videos
You can list your uploaded videos using a GET request. You can filter by type to only see videos.
```js theme={null}
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
// Filter by type=video
const url = 'https://api.fivemanage.com/api/v3/file?type=video';
axios.get(url, {
headers: { Authorization: apiKey }
}).then(res => {
console.log(res.data);
}).catch(err => {
console.error(err);
});
```
### Getting video details
To get details about a specific video, including its metadata, use the GET request with the file ID.
```js theme={null}
const axios = require('axios');
const apiKey = 'YOUR_API_TOKEN';
const fileId = '7F9pGhN8qwErT1vx5aZk';
const url = `https://api.fivemanage.com/api/v3/file/${fileId}`;
axios.get(url, {
headers: { Authorization: apiKey }
}).then(res => {
console.log(res.data);
}).catch(err => {
console.error(err);
});
```
# Configuration
Source: https://docs.fivemanage.com/hytale-sdk/configuration
Configure your logging providers and event tracking.
The Fivemanage Logger is configured using a `config.json` file located in `mods/Fivemanage_Logger/config.json`.
## Configuration Structure
The configuration is divided into two main sections: `LogProvider` and `Events`.
```json theme={null}
{
"LogProvider": {
"Provider": "fivemanage",
"ApiKey": "your-fivemanage-api-key",
"Endpoint": "",
"Username": "",
"Password": "",
"WriteToDisk": false,
"EnableBatching": true,
"BufferSize": 10,
"FlushIntervalMs": 5000
},
"Events": {
"ServerLifecycle": { "Enabled": true, "Dataset": "default" },
"ServerHeartbeat": { "Enabled": true, "Dataset": "server-metrics", "IntervalMs": 30000 },
"PlayerEvents": { "Enabled": true, "Dataset": "default" },
"Chat": { "Enabled": true, "Dataset": "default" },
"Combat": { "Enabled": true, "Dataset": "default" },
"BlockEvents": { "Enabled": false, "Dataset": "default" },
"Gameplay": { "Enabled": true, "Dataset": "default" },
"Exploration": { "Enabled": true, "Dataset": "default" },
"Inventory": { "Enabled": false, "Dataset": "default" }
}
}
```
## Log Provider Options
| Option | Type | Description |
| :---------------- | :-------- | :------------------------------------------------------------------------- |
| `Provider` | `string` | The logging backend to use: `fivemanage`, `grafana-loki`, or `loki`. |
| `ApiKey` | `string` | Your Fivemanage API key (required for `fivemanage` provider). |
| `Endpoint` | `string` | The Loki push endpoint URL (required for `grafana-loki`). |
| `Username` | `string` | Basic auth username for Grafana Loki. |
| `Password` | `string` | Basic auth password/API key for Grafana Loki. |
| `WriteToDisk` | `boolean` | If `true`, logs are also mirrored to local files in the `logs` directory. |
| `EnableBatching` | `boolean` | Whether to buffer logs before sending them to the provider. |
| `BufferSize` | `integer` | Number of logs to buffer before flushing (default: `10`). |
| `FlushIntervalMs` | `integer` | Maximum time (in ms) to wait before flushing the buffer (default: `5000`). |
Local file logging is enabled with `WriteToDisk`; `file` is not a standalone provider value.
## Provider Specifics
### Fivemanage Cloud
To use Fivemanage Cloud, set the provider to `fivemanage` and provide your API key.
```json theme={null}
"LogProvider": {
"Provider": "fivemanage",
"ApiKey": "YOUR_API_KEY"
}
```
### Grafana Loki
To send logs to Grafana Loki or Grafana Cloud, use the `grafana-loki` provider.
```json theme={null}
"LogProvider": {
"Provider": "grafana-loki",
"Endpoint": "https://logs-prod-us-central1.grafana.net/loki/api/v1/push",
"Username": "123456",
"Password": "your-grafana-api-key"
}
```
## Event Categories
All automatic logging is configured under the top-level `Events` object. Each category can be toggled independently and routed to its own dataset.
| Category | Default | Description |
| :---------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------ |
| `ServerLifecycle` | On | Server start and shutdown logs. |
| `ServerHeartbeat` | On | Periodic player count heartbeat logs for live dashboards. |
| `PlayerEvents` | On | Player connect, ready, disconnect, and session duration logs. |
| `Chat` | On | Player chat logs. |
| `Combat` | On | Player death and kill logs. |
| `BlockEvents` | Off | Block break and place logs. Disabled by default because it can be noisy. |
| `Gameplay` | On | Crafting, treasure, and game mode logs. |
| `Exploration` | On | Zone and instance discovery logs. |
| `Inventory` | Off | Inventory moves, drops, additions, creative item actions, and container/chest transfers. Disabled by default because it can be noisy. |
### Category Options
Every event category supports these options:
| Option | Type | Description |
| :-------- | :-------- | :---------------------------------------------------------------- |
| `Dataset` | `string` | The dataset (or label) where events for this category are stored. |
| `Enabled` | `boolean` | If `true`, events for this category are logged automatically. |
`ServerHeartbeat` additionally supports:
| Option | Type | Description |
| :----------- | :-------- | :----------------------------------------------------- |
| `IntervalMs` | `integer` | Heartbeat interval in milliseconds (default: `30000`). |
### Player Events
When `Events.PlayerEvents.Enabled` is set to `true`, the following events are captured:
* **Player Connect:** Logged when a player initiates a connection.
* **Player Ready:** Logged when a player has fully loaded into the world.
* **Player Disconnect:** Logged when a player leaves the server, including their session duration.
### Inventory Events
When `Events.Inventory.Enabled` is set to `true`, the plugin logs inventory activity such as:
* Item stack moves and smart moves between inventory sections.
* Item drops.
* Slot-level changes (items added, removed, or changed).
* Creative item actions.
* Container and chest window interactions.
Inventory events are disabled by default because they generate a high volume of logs. Consider routing them to a dedicated dataset if you enable them.
# Installation
Source: https://docs.fivemanage.com/hytale-sdk/installation
How to install the Fivemanage Logger plugin on your Hytale server.
Installing the Fivemanage Logger is a straightforward process. Follow these steps to get started.
## Prerequisites
* A Hytale dedicated server.
* Access to your server's `mods` directory.
## Step-by-Step Installation
### 1. Download the Plugin
Download the latest version of the Fivemanage Logger `.jar` file from the [official releases page](https://github.com/fivemanage/hytale-sdk/releases).
### 2. Upload to Server
Place the downloaded `.jar` file into your Hytale server's `mods` directory.
```bash theme={null}
/your-server-root/
└── mods/
└── Fivemanage_Logger.jar
```
### 3. Create Configuration Directory
The plugin expects a configuration file in a specific directory. Create a folder named `Fivemanage_Logger` inside your `mods` directory.
### 4. Create Configuration File
Inside the `Fivemanage_Logger` folder, create a file named `config.json`. You can use the [Configuration](/hytale-sdk/configuration) guide to set up your preferred logging provider.
```bash theme={null}
/your-server-root/
└── mods/
└── Fivemanage_Logger/
└── config.json
```
### 5. Restart Server
Restart your Hytale server to load the plugin. Check the server console to verify that the plugin has initialized correctly.
If the plugin is working correctly, you should see a message in the console: `[FivemanageLogger] Initialized with provider: `
# Introduction
Source: https://docs.fivemanage.com/hytale-sdk/introduction
The ultimate logging solution for Hytale dedicated servers.
The Fivemanage Hytale SDK is a powerful logging and analytics library designed specifically for Hytale dedicated servers. It allows you to track player activity, monitor server events, and send logs to Fivemanage or Grafana Loki, with optional local file mirroring.
## Key Features
Send logs to Fivemanage Cloud or Grafana Loki, with optional mirroring to local disk.
Asynchronous batched logging ensures zero impact on your server's TPS.
Automatically logs player sessions, chat, combat, gameplay, exploration, block, and inventory events.
Attach custom metadata to every log entry for powerful filtering and analysis.
## Why use Fivemanage Logger?
Logging is more than just printing text to a console. With Fivemanage Logger, you can:
* **Monitor Server Health:** Track errors and warnings in real-time.
* **Analyze Player Behavior:** Understand when players join, leave, and how they interact with your server.
* **Build Dashboards:** Use the logged data to create beautiful visualizations in Fivemanage or Grafana.
* **Audit Trails:** Maintain a complete history of important server events for security and administration.
# Usage
Source: https://docs.fivemanage.com/hytale-sdk/usage
How to use the Fivemanage Logger API in your own Hytale mods.
The Fivemanage Logger provides a simple static API that you can use in your own Hytale mods to send custom logs and analytics.
## Adding the Dependency
To use the API, you need to include the Fivemanage Logger as a dependency in your project.
### Maven
```xml theme={null}
org.fivemanage
Fivemanage
1.0.0
provided
```
## Logging Methods
The `FivemanageLogger` class provides several static methods for different log levels. Every method requires a `dataset` name, a `message`, and an optional `metadata` map.
### Log Levels
```java theme={null}
import com.fivemanage.FivemanageLogger;
import java.util.Map;
// Info level
FivemanageLogger.info("my-mod", "Something happened", metadata);
// Warning level
FivemanageLogger.warn("my-mod", "Something might be wrong", metadata);
// Error level
FivemanageLogger.error("my-mod", "Something went wrong!", metadata);
// Debug level
FivemanageLogger.debug("my-mod", "Detailed debug information", metadata);
```
## Using Metadata
Metadata is a powerful way to add context to your logs. It allows you to filter and aggregate data in your dashboards.
```java theme={null}
import com.fivemanage.FivemanageLogger;
import java.util.HashMap;
import java.util.Map;
Map metadata = new HashMap<>();
metadata.put("player_name", player.getName());
metadata.put("player_id", player.getId().toString());
metadata.put("location", player.getPosition().toString());
metadata.put("item_id", "hytale:stone");
FivemanageLogger.info("player-actions", "Player mined a block", metadata);
```
## Best Practices for API Usage
1. **Use Descriptive Datasets:** Group related logs into datasets (e.g., `economy`, `combat`, `admin-actions`).
2. **Consistent Metadata Keys:** Use consistent keys for metadata across different logs to make querying easier (e.g., always use `player_id` instead of mixing `uuid`, `player_uuid`, and `id`).
3. **Avoid High Cardinality in Messages:** Keep the `message` string relatively static and put variable data (like player names or coordinates) into the `metadata`.
4. **Don't Log Sensitive Info:** Never log passwords, private keys, or sensitive player information.
# Introduction to Fivemanage
Source: https://docs.fivemanage.com/index
The ultimate toolkit for game developers: High-performance CDN and structured logging.
Fivemanage is a comprehensive management platform designed to streamline game development and server operations. We provide the essential infrastructure for game creators to handle media assets and monitor server activity with ease.
By combining a lightning-fast **CDN** for game assets with a robust **Structured Logging** service, Fivemanage allows you to focus on building your game while we handle the heavy lifting of storage and data management.
## Core Products
Explore the two pillars of the Fivemanage ecosystem.
A high-performance content delivery network optimized for game assets. Host screenshots, textures, and videos with global availability and minimal latency. Perfect for in-game cameras, screenshot scripts, and media sharing.
Centralize your game logs in one searchable dashboard. Track player interactions, economy changes, and server performance with easy-to-use SDKs and deep search capabilities.
## Seamless Integration
Fivemanage is built for the modern game developer, with first-class support for popular platforms.
Native support for FiveM with our official Lua SDK. Integrate logging and media uploads into your scripts with just a few lines of code.
Bring professional-grade logging and media management to your Hytale experiences using our specialized tools and APIs.
## Why Choose Fivemanage?
Our global CDN ensures your images and videos load instantly for players anywhere in the world.
Minimal setup required. Create an account, get your API key, and start integrating in minutes.
From small community servers to massive games with thousands of players, Fivemanage scales with you.
## Next Steps
Get started today or join our community for support.
Follow our three-step guide to get your account set up and start using our services.
Get real-time support, request features, and connect with other developers in our community.
# Configuration
Source: https://docs.fivemanage.com/lite/guides/configuration
Configure Fivemanage Lite environment variables and dependencies.
# Configuration
Fivemanage Lite is configured entirely via environment variables. This makes it easy to deploy in containerized environments like Docker and Kubernetes.
## Environment Variables
| Variable | Description | Required | Default |
| :---------------------- | :---------------------------------------- | :---------: | :---------------- |
| `PORT` | Port the server listens on | No | `8080` |
| `DSN` | PostgreSQL connection string | **Yes** | - |
| `ADMIN_PASSWORD` | Password for the initial admin account | **Yes** | `password` |
| `API_TOKEN_HMAC_SECRET` | 32-byte secret key for signing API tokens | **Yes** | - |
| `CLICKHOUSE_HOST` | Address of the ClickHouse server | No | `localhost:19000` |
| `CLICKHOUSE_USERNAME` | ClickHouse username | No | `default` |
| `CLICKHOUSE_PASSWORD` | ClickHouse password | No | `password` |
| `CLICKHOUSE_DATABASE` | ClickHouse database name | No | `default` |
| `S3_PROVIDER` | Storage backend: `s3`, `r2`, or `minio` | No | `minio` |
| `AWS_ACCESS_KEY_ID` | S3 Access Key | If using S3 | - |
| `AWS_SECRET_ACCESS_KEY` | S3 Secret Key | If using S3 | - |
| `AWS_BUCKET` | Target bucket name | If using S3 | - |
| `AWS_REGION` | S3 region | If using S3 | - |
| `AWS_ENDPOINT` | Custom endpoint (required for MinIO/R2) | No | - |
| `ENV` | Environment mode (`production` or `dev`) | No | `dev` |
## Infrastructure Dependencies
To run a fully functional instance, you must provision the following dependencies:
### 1. PostgreSQL (Primary Database)
Used for storing relational data, including user accounts, organization hierarchies, file metadata, and API tokens.
* **Version**: 14+ recommended.
* **Connection**: Configured via the `DSN` environment variable.
### 2. ClickHouse (Log Store)
Used for the high-performance ingestion and querying of structured logs. This is mandatory if you intend to use the logging features.
* **Why ClickHouse?**: It handles millions of log rows with minimal storage footprint and instant query speeds compared to traditional SQL databases.
### 3. S3-Compatible Storage
Used for storing actual file assets (images, user uploads).
* **Supported Providers**: AWS S3, Cloudflare R2, or MinIO (for self-hosting).
### 4. OpenTelemetry (Optional)
The application has native tracing support. You can connect it to a collector like **Jaeger** to visualize request flows and performance bottlenecks.
# Developing & Contributing
Source: https://docs.fivemanage.com/lite/guides/contributing
Learn how to build Fivemanage Lite from source and contribute to the project.
# Developing & Contributing
Follow these instructions if you want to contribute to the project or build from source.
## Prerequisites
* **Go**: 1.24 or later
* **Node.js**: 22.x or later
* **pnpm**: 9.x or later
* **Air**: For backend hot-reloading
* **Docker**: For running local infrastructure
## Initial Setup
1. **Clone the repository:**
```bash theme={null}
git clone https://github.com/fivemanage/fivemanage-lite.git
cd fivemanage-lite
```
2. **Install Frontend Dependencies:**
```bash theme={null}
cd web
pnpm install
cd ..
```
3. **Download Backend Dependencies:**
```bash theme={null}
go mod download
```
4. **Start Development Infrastructure:**
This will spin up the required databases (Postgres, ClickHouse, MinIO) in the background.
```bash theme={null}
docker compose -f deployments/docker-compose.yml up -d
```
## Running for Development
Run the backend and frontend in separate terminals.
1. **Backend:**
```bash theme={null}
air
```
2. **Frontend:**
```bash theme={null}
cd web
pnpm dev
```
## Project Structure
* `cmd/lite`: Main entry point and CLI configuration.
* `internal/`: Application logic, API handlers, and services.
* `pkg/`: Reusable packages for storage, logging, and caching.
* `web/`: Frontend React application.
* `deployments/`: Docker Compose and deployment configurations.
* `migrate/`: PostgreSQL schema migrations.
* `build/`: Dockerfile and build scripts.
## Contributing Guidelines
1. **Branching:** Use descriptive branch names (`feature/*`, `fix/*`).
2. **Formatting:** Use `go fmt` and `pnpm lint`.
3. **Commits:** Provide clear, professional messages.
4. **Pull Requests:** Provide a detailed description of changes.
# Introduction to Fivemanage Lite
Source: https://docs.fivemanage.com/lite/guides/introduction-to-lite
An overview of the open-source, self-hosted version of Fivemanage.
# Fivemanage Lite
## Introduction
**Fivemanage Lite** is the open-source, self-hosted edition of the Fivemanage platform. It is a lightweight yet powerful backend solution designed specifically for gaming communities (such as FiveM) to handle infrastructure needs without relying on external SaaS providers.
The project is built as a stateless **Go** backend paired with a modern **React** dashboard. It focuses on three core operational pillars:
* **Media Hosting**: A centralized asset store compatible with S3 providers (AWS, Cloudflare R2, MinIO).
* **Structured Logging**: High-throughput log ingestion powered by ClickHouse, allowing for real-time searching and filtering of game events.
* **Multi-Tenant Management**: Built-in support for organizations, members, and API token management.
## Features
Fivemanage Lite comes packed with essential features for community management:
* **Multi-tenant organization support**: Manage multiple groups or communities from a single instance.
* **File storage**: Seamless integration with S3-compatible providers (AWS S3, Cloudflare R2, MinIO) for handling user uploads and assets.
* **High-performance logging**: Powered by ClickHouse to ingest and query millions of log entries with minimal latency.
* **Authentication**: Built-in session management and secure authentication flows.
* **Observability**: Native OpenTelemetry integration for tracing and performance monitoring.
* **Modern Dashboard**: A responsive, React-based administrative interface for managing your instance.
## Architecture
Fivemanage Lite is designed to be stateless and scalable. It offloads persistence to specialized services, ensuring reliability and performance.
* **Backend**: Written in Go, providing a fast and efficient API.
* **Frontend**: A React application serving as the control plane.
* **Database**: PostgreSQL for relational data (users, settings).
* **Log Store**: ClickHouse for high-volume event logging.
* **Object Storage**: S3-compatible API for file persistence.
# ClickHouse Setup
Source: https://docs.fivemanage.com/lite/guides/logs-storage/clickhouse
Configure ClickHouse for high-performance log ingestion.
# ClickHouse Setup
Fivemanage Lite uses **ClickHouse** as its primary storage engine for structured logs. ClickHouse is an open-source column-oriented database management system that allows generating analytical data reports in real-time.
It is chosen for its exceptional performance with high-volume write operations (log ingestion) and fast analytical queries (filtering and searching logs).
## Running ClickHouse
We recommend using the official Docker image `clickhouse/clickhouse-server`.
### Docker Command
To run a basic ClickHouse instance:
```bash theme={null}
docker run -d \
--name clickhouse-server \
--ulimit nofile=262144:262144 \
-p 8123:8123 \
-p 9000:9000 \
-e CLICKHOUSE_PASSWORD=password \
-v clickhouse_data:/var/lib/clickhouse \
clickhouse/clickhouse-server:latest
```
### Docker Compose
For a production-ready setup integrated with your stack:
```yaml theme={null}
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
container_name: lite-clickhouse
restart: always
ports:
- '8123:8123' # HTTP Interface
- '9000:9000' # Native Interface (Used by Fivemanage Lite)
environment:
- CLICKHOUSE_USER=default
- CLICKHOUSE_PASSWORD=your_secure_password
- CLICKHOUSE_DB=default
ulimits:
nofile:
soft: 262144
hard: 262144
volumes:
- clickhouse_data:/var/lib/clickhouse/
- ./clickhouse-config.xml:/etc/clickhouse-server/config.d/custom_config.xml
volumes:
clickhouse_data:
```
## Configuration
### Environment Variables
| Variable | Description | Default |
| :-------------------- | :----------------------------------------- | :--------- |
| `CLICKHOUSE_USER` | The username for authentication. | `default` |
| `CLICKHOUSE_PASSWORD` | The password for the user. | `password` |
| `CLICKHOUSE_DB` | The default database to create on startup. | `default` |
### Connecting Fivemanage Lite
Once ClickHouse is running, configure Fivemanage Lite to connect to it using the following environment variables:
```bash theme={null}
CLICKHOUSE_HOST=localhost:9000
CLICKHOUSE_USERNAME=default
CLICKHOUSE_PASSWORD=your_secure_password
CLICKHOUSE_DATABASE=default
```
## Production Recommendations
### 1. Volume Persistence
Always mount a volume for `/var/lib/clickhouse`. If you don't, you will lose all log data when the container restarts.
### 2. File Limits (ulimits)
ClickHouse requires a high number of open file descriptors.
* **Docker**: Use `--ulimit nofile=262144:262144`.
* **Systemd/Linux**: Ensure `/etc/security/limits.conf` allows high open files for the user running Docker or ClickHouse.
### 3. Resource Allocation
ClickHouse loves RAM. For a small to medium community, **4GB - 8GB RAM** is a good starting point. It is highly efficient, but complex queries over millions of logs will benefit from more memory.
### 4. Security
* **Change the default password**: Never use `password` in production.
* **Network Isolation**: Do not expose port `9000` (Native) or `8123` (HTTP) to the public internet. Only Fivemanage Lite needs access to port `9000`.
## Troubleshooting
**"Connection refused"**
* Ensure the container is running: `docker ps`
* Check logs: `docker logs lite-clickhouse`
* Verify you are using the correct port (`9000` for the Go application, not `8123`).
**"Too many open files"**
* Check your ulimits configuration as described in the Production Recommendations section.
# MinIO Setup
Source: https://docs.fivemanage.com/lite/guides/logs-storage/minio
Configure MinIO for self-hosted S3-compatible storage.
# MinIO Setup
Fivemanage Lite supports any S3-compatible storage provider for handling file uploads. **MinIO** is the recommended solution for a fully self-hosted environment, offering high-performance object storage that is API compatible with Amazon S3.
## Running MinIO
We recommend using the official Docker image `minio/minio:latest`.
### Docker Command
To run a basic MinIO instance:
```bash theme={null}
docker run -d \
--name minio \
-p 9000:9000 \
-p 9001:9001 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin123 \
-v minio_data:/data \
minio/minio:latest server /data --console-address ":9001"
```
### Docker Compose
For a production-ready setup integrated with your stack:
```yaml theme={null}
services:
minio:
image: minio/minio:latest
container_name: lite-minio
restart: always
ports:
- "9000:9000" # API Port
- "9001:9001" # Console Port
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: your_secure_password
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
volumes:
minio_data:
```
## Configuration
### Environment Variables
| Variable | Description | Default |
| :-------------------- | :------------------ | :-------------- |
| `MINIO_ROOT_USER` | The admin username. | `minioadmin` |
| `MINIO_ROOT_PASSWORD` | The admin password. | `minioadmin123` |
### Connecting Fivemanage Lite
Once MinIO is running, you need to create a bucket (e.g., `fivemanage`) and configure the application to connect to it.
1. **Access the Console**: Go to `http://localhost:9001` and login.
2. **Create Bucket**: Create a new bucket named `fivemanage`.
3. **Set Policy**: Ensure the bucket or specific paths are accessible if you want public downloads (though Fivemanage Lite handles signed URLs for private files).
Configure Fivemanage Lite with these environment variables:
```bash theme={null}
S3_PROVIDER=minio
AWS_ENDPOINT=http://localhost:9000
AWS_ACCESS_KEY_ID=minioadmin
AWS_SECRET_ACCESS_KEY=your_secure_password
AWS_BUCKET=fivemanage
AWS_REGION=us-east-1
```
## Production Recommendations
### 1. Volume Persistence
Always mount a volume for `/data`. Losing this volume means losing all uploaded files.
### 2. Security
* **Change Default Credentials**: Never use `minioadmin` / `minioadmin123` in production.
* **TLS/SSL**: In a production environment, you should run MinIO behind a reverse proxy (like Nginx or Traefik) that handles SSL termination, or configure MinIO with certificates directly.
### 3. Public Access
By default, MinIO buckets are private. Fivemanage Lite generates presigned URLs for secure access. If you need public hosting (e.g., for direct image linking without signatures), you will need to configure the bucket policy in MinIO to allow `readonly` access to the `*` resource.
## Troubleshooting
**"Connection refused"**
* Ensure you are connecting to the API port (`9000`), not the Console port (`9001`).
* If running in Docker Compose, use the service name (e.g., `http://lite-minio:9000`) as the endpoint.
**"Access Denied"**
* Verify `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` match `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD`.
* Ensure the bucket specified in `AWS_BUCKET` actually exists.
# Quickstart
Source: https://docs.fivemanage.com/lite/guides/quickstart
Get Fivemanage Lite up and running in minutes using Docker.
# Quickstart
You can deploy Fivemanage Lite using the pre-built Docker image or by orchestrating the entire stack with Docker Compose.
## Option A: Production Docker Run
If you already have your databases (Postgres/ClickHouse) running, you can start the application container directly.
```bash theme={null}
docker run -d \
--name fivemanage-lite \
-p 8080:8080 \
-e DSN="postgres://user:password@your-postgres-host:5432/fivemanage?sslmode=disable" \
-e CLICKHOUSE_HOST="your-clickhouse-host:9000" \
-e ADMIN_PASSWORD="secure_admin_password" \
-e API_TOKEN_HMAC_SECRET="your_32_byte_random_secret_string" \
ghcr.io/fivemanage/lite:latest
```
## Option B: Full Stack via Docker Compose
For a complete self-hosted environment including all dependencies, use the provided `docker-compose.yml`. This will spin up Postgres, ClickHouse, MinIO, and Jaeger alongside the application.
1. **Create a `docker-compose.yml` file:**
```yaml theme={null}
version: '3.8'
services:
lite:
image: ghcr.io/fivemanage/lite:latest
ports:
- "8080:8080"
environment:
- DSN=postgres://postgres:root@lite-database:5432/fivemanage-lite-dev?sslmode=disable
- CLICKHOUSE_HOST=lite-clickhouse:9000
- ADMIN_PASSWORD=password
- API_TOKEN_HMAC_SECRET=change_this_to_a_secure_random_string
- S3_PROVIDER=minio
- AWS_ENDPOINT=http://lite-minio:9000
- AWS_ACCESS_KEY_ID=minioadmin
- AWS_SECRET_ACCESS_KEY=minioadmin123
- AWS_BUCKET=fivemanage
- AWS_REGION=us-east-1
depends_on:
- lite-database
- lite-clickhouse
- lite-minio
lite-database:
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
POSTGRES_DB: fivemanage-lite-dev
volumes:
- postgres_data:/var/lib/postgresql/data
lite-clickhouse:
image: clickhouse/clickhouse-server:latest
environment:
CLICKHOUSE_PASSWORD: password
ports:
- '18123:8123'
- '19000:9000'
volumes:
- clickhouse_data:/var/lib/clickhouse/
lite-minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin123
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
volumes:
postgres_data:
clickhouse_data:
minio_data:
```
2. **Start the stack:**
```bash theme={null}
docker-compose up -d
```
## Initial Login
Once the application is running, access the dashboard at `http://localhost:8080`.
* **Username:** `admin`
* **Password:** The value of your `ADMIN_PASSWORD` environment variable (default is `password` in the example above).
# Migrate from Fivemerr
Source: https://docs.fivemanage.com/migrate-from-fivemerr
Learn how to migrate your files from Fivemerr to Fivemanage
Fivemerr is shutting down, but you can easily move all your files to Fivemanage using our automated migration tool. This guide will walk you through the process.
## Prerequisites
Before you begin, make sure you have:
1. A [Fivemanage account](https://app.fivemanage.com).
2. Created a team on Fivemanage.
## Step 1: Export Data from Fivemerr
First, you need to get the list of your files from Fivemerr.
1. Log in to your **Fivemerr dashboard**.
2. Navigate to the **Media** tab
3. Click on **Export** to download a file containing all your file URLs.
## Step 2: Start Migration on Fivemanage
Once you have your CSV file, head over to Fivemanage.
1. Go to your [Fivemanage Dashboard](https://app.fivemanage.com).
2. Select your team.
3. Navigate to **Storage** > **Migration**.
4. Drag and drop your Fivemerr CSV file into the upload area.
## Step 3: Review and Migrate
After uploading the CSV, you'll see a preview of the files to be migrated.
* **File Stats**: You'll see the total number of files and their total size.
* **Retention Exemption**: You can choose to **exempt these files from retention policies**. This ensures they are never automatically deleted, even if you enable retention rules later.
Click **Start Migration** to begin the process.
## Step 4: Monitor Progress
The migration runs in the background. You can close the tab and come back later, but staying on the page allows you to monitor progress in real-time.
The status will change from **Queued** to **Processing** as files are downloaded from Fivemerr and uploaded to Fivemanage.
## Important Limits & Notes
### Free Tier & Storage Limits
If you are on the **Free Tier**, you have a 10GB storage limit. However, for this migration:
* **You CAN migrate more than 10GB**: We allow you to migrate your entire Fivemerr library, even if it exceeds the 10GB free limit.
* **Upload Restriction**: Once you exceed the 10GB limit, you will **not be able to upload new files** until you upgrade your plan or delete files to get back under the limit.
Use code **FIVEMERR50** for 50% off your first month of any paid plan if you need more storage!
### Large Files
Large video files may take longer to process. Our system handles files of any size, but please be patient with larger uploads.
### File URLs
We preserve your original Fivemerr file paths to make the transition as easy as possible. You only need to replace the domain in your scripts or configuration files.
* **Old URL**: `https://files.fivemerr.com/images/example.png`
* **New URL**: `https://r2.fivemanage.com/images/example.png`
Simply find and replace `files.fivemerr.com` with `r2.fivemanage.com` in your codebase, and your files will continue to work seamlessly.
# Quickstart
Source: https://docs.fivemanage.com/quickstart
Start using Fivemanage in a couple steps.
## Get started in three steps
Create an account, an API key and start uploading.
### Step 1: Sign up
Head over to [Fivemanage](\[https://app.fivemanage.com]\(https://app.fivemanage.com/\)) to create your account.
Once you have created your user, you will be able to create a team. Choose the name and the type of team you're creating. Once you've done that, come back here.
### Step 2: Generate a API key
Navigate over to [Tokens](https://app.fivemanage.com?to=/dashboard/:teamId/token) to create your first token.
When creating an API key, you can choose between different scopes:
1. Images
2. Videos
3. Audio
4. Media (all of the above)
5. Logs
Give it a name that breifly explains what it's for.
### Step 3: Go live
1. Commit and push your changes.
2. Your docs will update and be live in moments!
## Next steps
Now that you have your docs running, explore these key features:
Learn MDX syntax and start writing your documentation.
Make your docs match your brand perfectly.
Include syntax-highlighted code blocks.
Auto-generate API docs from OpenAPI specs.
**Need help?** See our [full documentation](https://mintlify.com/docs) or join our [community](https://mintlify.com/community).