New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@mocito/install-telemetry

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mocito/install-telemetry

Best-effort, once-per-version install telemetry for Node.js tools.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

@mocito/install-telemetry

A small, runtime-agnostic helper for optional install/update telemetry in Node.js tools. It reports each tool version at most once, retries after failed requests, and prevents duplicate reports from concurrent processes.

Usage

The library owns telemetry mechanics. The application owns its tool name, version, state location, and opt-out policy:

import { reportInstallTelemetry } from "@mocito/install-telemetry";

void reportInstallTelemetry({
  endpoint: "https://telemetry.example.com/api/report-install",
  tool: "my-tool",
  version: "1.2.3",
  statePath: "/home/user/.local/state/my-tool/install-telemetry.json",
  enabled: process.env.CI !== "true",
});

Use a user-private state path. Do not pass prompts, credentials, paths, or other user data as tool or version.

Behavior

  • Sends only tool, version, and a bounded runtime User-Agent.
  • Uses the caller-configured HTTPS endpoint.
  • Times out after five seconds and ignores network/filesystem failures.
  • Writes the version marker only after a successful HTTP response.
  • Uses an exclusive lock and stale-lock recovery to serialize concurrent callers.
  • Does nothing when enabled is false or metadata fails the server-safe format checks.

The endpoint is required, must use HTTPS, and cannot contain credentials or a fragment. The timeout is intentionally fixed. Tests can inject fetch without changing production routing.

Keywords

install-telemetry

FAQs

Package last updated on 02 Aug 2026

Related posts