Spaces:
Configuration error
Configuration error
Download scripts/telemetry.js from SreejithSHR/umami: direct link, hf CLI and curl.
- Browser
- Download file 820 Bytes
-
https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/scripts/telemetry.js
- Command line
-
hf download hf://spaces/SreejithSHR/umami/scripts/telemetry.js
-
curl -L -o telemetry.js https://huggingface.co/spaces/SreejithSHR/umami/resolve/main/scripts/telemetry.js
820 Bytes
| const os = require('os'); | |
| const isCI = require('is-ci'); | |
| const pkg = require('../package.json'); | |
| const url = 'https://api.umami.is/v1/telemetry'; | |
| async function sendTelemetry(type) { | |
| const { default: isDocker } = await import('is-docker'); | |
| const { default: fetch } = await import('node-fetch'); | |
| const data = { | |
| type, | |
| payload: { | |
| version: pkg.version, | |
| node: process.version, | |
| platform: os.platform(), | |
| arch: os.arch(), | |
| os: `${os.type()} ${os.version()}`, | |
| is_docker: isDocker(), | |
| is_ci: isCI, | |
| }, | |
| }; | |
| try { | |
| await fetch(url, { | |
| method: 'post', | |
| cache: 'no-cache', | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| }, | |
| body: JSON.stringify(data), | |
| }); | |
| } catch { | |
| // Ignore | |
| } | |
| } | |
| module.exports = { | |
| sendTelemetry, | |
| }; | |