# @salesforce/plugin-telemetry

> Command usage and error telemetry for the Salesforce CLI

Latest version **4.1.1** (published 2026-10-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @salesforce/plugin-telemetry
pnpm add @salesforce/plugin-telemetry
yarn add @salesforce/plugin-telemetry
bun add @salesforce/plugin-telemetry
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2026-10-02 |
| First published | 2021-01-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22.0.0 |
| Dependencies | 7 |
| Unpacked size | 107.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 4 |
| Author | Salesforce |
| Maintainers | ire-npm-team-user, jimjag, salesforce-releases, jasonschroeder-sfdc, mobify, lwc-admin, salesforce-admin |
| Keywords | force, salesforce, salesforcedx, sf-plugin, sf, sfdx-plugin, sfdx |

## Links

- npm: https://www.npmjs.com/package/@salesforce/plugin-telemetry
- Repository: https://github.com/salesforcecli/plugin-telemetry
- Issues: https://github.com/forcedotcom/cli/issues
- npm.io page: https://npm.io/package/@salesforce/plugin-telemetry

## Dependencies (7)

- [debug](https://npm.io/package/debug.md) ^4.4.3
- [@oclif/core](https://npm.io/package/@oclif/core.md) ^5.0.0
- [@salesforce/kit](https://npm.io/package/@salesforce/kit.md) ^4.0.0
- [@salesforce/core](https://npm.io/package/@salesforce/core.md) ^9.0.0
- [@salesforce/ts-types](https://npm.io/package/@salesforce/ts-types.md) ^3.0.1
- [@salesforce/telemetry](https://npm.io/package/@salesforce/telemetry.md) ^7.0.4
- [@salesforce/sf-plugins-core](https://npm.io/package/@salesforce/sf-plugins-core.md) ^13.0.4

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 4.1.1 (latest) — 2026-10-02
- 3.3.5-qa.0 (qa) — 2024-04-22
- 2.3.9-dev.0 (dev) — 2023-10-27
- 4.1.0 — 2026-09-23
- 4.0.7 — 2026-09-01
- 4.0.6 — 2026-08-21
- 4.0.5 — 2026-08-15
- 4.0.4 — 2026-08-15
- 4.0.3 — 2026-08-08
- 4.0.2 — 2026-08-04
- 4.0.1 — 2026-08-01
- 4.0.0 — 2026-07-30
- 3.8.33 — 2026-07-25
- 3.8.32 — 2026-07-24
- 3.8.31 — 2026-07-18
- … 193 more at https://npm.io/package/@salesforce/plugin-telemetry/versions

## README

# plugin-telemetry

[![NPM](https://img.shields.io/npm/v/@salesforce/plugin-telemetry.svg?label=@salesforce/plugin-telemetry)](https://www.npmjs.com/package/@salesforce/plugin-telemetry) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/plugin-telemetry.svg)](https://npmjs.org/package/@salesforce/plugin-telemetry) [![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/license/apache-2-0)

A plugin to record command usage and error telemetry for the Salesforce CLI.

This plugin is bundled with the CLI and will automatically collect usage data on all commands and plugins. To disable data collection, see [this help document](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_telemetry.htm).

**Note: This plugin should be included at a CLI level ONLY. No CLI plugins should include or depend on this plugin.**

All command usage is recorded by initializing on the `init` oclif hook, recording all events to a log file, then spawning a process on exit to send the data to appinsights.

To debug the telemetry spawned process, run a command with the environment variables `SF_TELEMETRY_DEBUG=true` and `DEBUG=sf:telemetry`.

```bash
SF_TELEMETRY_DEBUG=true DEBUG=sf:telemetry* ./bin/dev telemetry
```

## Getting Started

To build the plugin locally, make sure to have yarn installed and run the following commands:

```bash
# Clone the repository
git clone git@github.com:salesforcecli/plugin-telemetry

# Install the dependencies and compile
yarn install
yarn build
```

To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.

```bash
# Run using local run file.
./bin/dev telemetry
```

There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.

```bash
# Link your plugin to the sfdx cli
sf plugins:link .
# To verify
sf plugins
```

---
_Source: https://npm.io/package/@salesforce/plugin-telemetry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
