# 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. Mass delete interface with date range selector 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. Upload button in the storage dashboard 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. Upload dialog with drag and drop zone 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. Invite Member button 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.