@esri/telemetry-siteimprove

中文文档
5.1.2发布于 2026/10/23Apache-2.0TypeScriptESM + CJS零依赖近 30 天下载 6438

Esri telemetry package for Siteimprove

原始使用文档
文档目录8 节
  1. Table of Contents
  2. Installation
  3. How It Works
  4. Browser
  5. Server
  6. Issues
  7. Contributing
  8. License

@esri/telemetry-siteimprove

Siteimprove plugin for @esri/telemetry. This package creates the Siteimprove script with appropriate attributes and injects it into the DOM.

Table of Contents

Installation

npm install @esri/telemetry @esri/telemetry-siteimprove

How It Works

@esri/telemetry-siteimprove package works in the client-side browser and server-side Node.js. To use, install the package, include it in your project, create an instance of the plugin, and add it to the plugins array with @esri/telemetry

Below is an example of how to use the browser plugin.

Browser

import { Telemetry } from '@esri/telemetry'
import { Siteimprove } from '@esri/telemetry-siteimprove'

const siteimproveTracker = new Siteimprove({
  code: 'XXXXXX' // required, replace with code
})

const telemetryOptions = {
  plugins: [siteimproveTracker],
  portal: {
    subscriptionInfo: {},
    user: {},
  },
}

const telemetry = new Telemetry(telemetryOptions)
await telemetry.init();

telemetry.logPageView({page: 'home'}) // Required
telemetry.logEvent({
  action: 'Download', // Required
  category: 'Dataset', // Required
  label: 'New' // Optional

})

Server

import { Telemetry } from '@esri/telemetry';
import { Siteimprove } from '@esri/telemetry-siteimprove';

const siteimproveTracker = new Siteimprove({
  code: 'XXXXXX' // required, replace with code
});

const telemetryOptions = {
  plugins: [siteimproveTracker],
  portal: {
    subscriptionInfo: {},
    user: {},
  },
};

const telemetry = new Telemetry(telemetryOptions);

const scriptTags = telemetry.getScriptTags();

After initializing Telemetry.js with the telemetry-siteimprove plugin, telemetry data will be sent to the Siteimprove Analytics instance associated with the provided Siteimprove ID.

Issues

If something isn't working, please take a look at previously logged issues first. Have you found a new bug? Create an issue here.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

License

Copyright © 2022 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE file.

版本与发布记录

@esri/telemetry-siteimprove 共发布 33 个版本,首次发布于 2022/05/03;过去 12 个月发布了 1 个版本。

版本发布日期距今
5.1.2latest2026/10/2322 天前
5.1.12025/07/121.3 年前
5.1.02025/07/111.3 年前
5.0.02025/07/101.3 年前
4.0.22025/04/161.6 年前
4.0.12024/03/212 年前

其他发布通道:next → 3.1.4。

关于 @esri/telemetry-siteimprove 的常见问题

@esri/telemetry-siteimprove 是什么?

Esri telemetry package for Siteimprove

如何安装 @esri/telemetry-siteimprove?

在项目目录运行 npm install @esri/telemetry-siteimprove,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@esri/telemetry(^8.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@esri/telemetry-siteimprove 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@esri/telemetry-siteimprove 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@esri/telemetry-siteimprove 可以商用吗?

@esri/telemetry-siteimprove 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@esri/telemetry-siteimprove 的下载量有多少?

根据 npm 官方下载统计,@esri/telemetry-siteimprove 在 2026/10/14 – 2026/11/12 这 30 天内被下载 6,438 次,日均约 215 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@esri/telemetry-siteimprove 还在维护吗?

最新版本 5.1.2 发布于 2026/10/23(22 天前);至今共发布 33 个版本,其中过去 12 个月发布了 1 个;首次发布于 2022/05/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。