Developer Plugin Documentation & API Reference
Hydro Clips features an integrated Hot-Reloading JavaScript Plugin Engine. You can extend the recorder with custom AI commentators, Discord webhooks, stats trackers, and in-game HUD overlays.
1. Plugin Directory & Structure
Each plugin resides in its own folder inside %APPDATA%\Hydro Clips\plugins\<plugin-id>\. It consists of two essential files:
%APPDATA%\Hydro Clips\plugins\my-plugin\
├── plugin.json (Plugin metadata, configuration schema, and UI parameters)
└── index.js (Main sandboxed JavaScript execution code)
2. Manifest Specification (plugin.json)
The plugin.json file defines how your plugin appears in the Hydro Clips in-app Smoked Glass Plugin Manager and dynamically renders settings inputs:
{
"id": "ai-caster-pro",
"name": "AI Game Caster Pro",
"version": "1.0.0",
"description": "Analyzes clips and speaks live esports commentary.",
"author": "YourName",
"enabled": true,
"main": "index.js",
"config": {
"apiKey": "",
"casterStyle": "Hype / Heyecanli E-Spor Spikeri"
},
"configSchema": {
"apiKey": {
"label": "OpenAI / Gemini API Key",
"type": "password",
"default": "",
"description": "API key for real-time commentary."
},
"casterStyle": {
"label": "Commentator Persona",
"type": "select",
"options": ["Hype / Heyecanli E-Spor Spikeri", "Analitik Koc", "Troll Yayinci"],
"default": "Hype / Heyecanli E-Spor Spikeri"
}
}
}
3. Lifecycle Event Hooks
| Hook Name |
Arguments |
Description |
onInit(context) |
context |
Triggered when Hydro Clips boots or when the plugin is reloaded. |
onClipSaved(clip, context) |
clip, context |
Fires immediately after an Instant Replay (Alt+F11) or manual recording is finalized. |
onRecordingStart(context) |
context |
Fires when manual recording begins (Alt+F9). |
onRecordingStop(context) |
context |
Fires when manual recording is stopped. |
onScreenshot(clip, context) |
clip, context |
Fires when a screenshot is taken (Alt+F1). |
4. Injected Context API Methods
| Method |
Signature |
Description |
context.showNotification() |
(title, message, type) |
Displays an in-game HUD notification toast. Types: 'recording', 'info', 'success'. |
context.fetch() |
(url, options) |
Native HTTP request client for calling OpenAI, Gemini, Discord Webhooks, or REST APIs. |
context.log() |
(message, level) |
Prints timestamped logs directly into the in-app Live Plugin Console. |
context.getConfig() |
() => Record<string, any> |
Returns current user-configured values from the in-app settings UI. |
context.saveConfig() |
(newConfig) => void |
Persists updated plugin parameters to disk. |
5. Production Sample: AI Esports Commentator
/**
* Hydro Clips - AI Esports Commentator Plugin
*/
module.exports = {
onInit(context) {
context.log("AI Commentator initialized and listening.");
},
async onClipSaved(clip, context) {
const config = context.getConfig() || {};
context.log("Analyzing clip: " + clip.name + " (" + clip.duration + "s)");
let commentary = "Incredible clutch play! Surgical precision on target.";
if (config.apiKey && config.apiKey.length > 5) {
try {
const res = await context.fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer " + config.apiKey,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Act as an esports caster. Give a 1-sentence hype comment." }]
})
});
const data = await res.json();
if (data.choices && data.choices[0]) commentary = data.choices[0].message.content;
} catch (err) {
context.log("AI API Notice: " + err.message, "warn");
}
}
// Display in-game HUD toast:
context.showNotification("AI Caster Comment", commentary, "recording");
}
};
6. Production Sample: Discord Webhook Embed Notifier
/**
* Hydro Clips - Discord Webhook Notifier
*/
module.exports = {
async onClipSaved(clip, context) {
const config = context.getConfig() || {};
if (!config.webhookUrl) return context.log("No webhook URL configured.", "warn");
try {
await context.fetch(config.webhookUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
username: "Hydro Clips Bot",
embeds: [{
title: "New Gaming Clip Captured!",
description: "**File:** " + clip.name + "\n**Duration:** " + clip.duration + " seconds",
color: 3723768,
timestamp: new Date().toISOString()
}]
})
});
context.log("Discord notification delivered!", "success");
} catch (e) {
context.log("Discord error: " + e.message, "error");
}
}
};