feat(plugins): report install beacon after successful installs
This commit is contained in:
1 file changed
+17
@@ -349,7 +349,24 @@ async function handleWebPackage(event: Event) {
|
||||
if (file) await installPlugin(file);
|
||||
}
|
||||
|
||||
// Fire-and-forget install beacon for the marketplace stats worker
|
||||
// (deploy/plugin-stats-worker, POST dbxio.com/api/plugins/install).
|
||||
// Decorative counters only: no auth, no PII, failures are never surfaced.
|
||||
function reportInstallBeacon(result: PluginInstallResult) {
|
||||
try {
|
||||
void fetch("https://dbxio.com/api/plugins/install", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ id: result.plugin.manifest.id, version: result.plugin.manifest.version }),
|
||||
keepalive: true,
|
||||
}).catch(() => {});
|
||||
} catch {
|
||||
// stats only — ignore beacon failures
|
||||
}
|
||||
}
|
||||
|
||||
async function finishInstall(result: PluginInstallResult) {
|
||||
reportInstallBeacon(result);
|
||||
toast(t("pluginPlatform.installSuccess", { name: result.plugin.manifest.name, version: result.plugin.manifest.version }));
|
||||
clearPluginIconCache();
|
||||
installedPlugins.value = await api.listPlugins();
|
||||
|
||||
Reference in new issue
Block a user