npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@esri/telemetry

v9.1.1

Published

A JavaScript Implementation of the ArcGIS Telemetry Specification

Downloads

10,363

Readme

@esri/telemetry

This is the "core" package for ArcGIS-Telemetry.js. It is necessary for sending data to analytics platforms such as Google, Adobe, and AWS.

Table of Contents

Installation

npm install @esri/telemetry

Usage

Privacy Tracking Consent

Starting with version 7.x, telemetry.js has support for privacy tracking consent. The host application can decide to enable this behavior passing .requireConsent in the options passed into the constructor, along with an optional IPrivacySettings object. The example below shows this structure.

Users can consent to the following types of "tracking":

  • Performance: Allows only application performance information to be sent and stored
  • Functional: Allows for functional information to be stored, like perferences, past searches etc
  • Targeting: Allows for user targeting information to be sent

When requireConsent is passed, and no userPrivacySettings is sent, telemetry.js operates as though the user has opted out of all tracking. This is expected behavior as per GDPR.

When userPrivacySettings.performance: true, and the Esri amazon pin-point tracker is configured as a plugin, it will be initialized.

For Hub Sites (and some other platform applications) customers can configure additional 3rd party tracking systems (Google Analytics, Adobe, SiteImprove). In order for those trackers to be enabled, the end-user must opt into performance, functional and targeting, because we do not know or control what the 3rd party trackers are doing, so we must assume they are tracking all three.

In Browser

import { Telemetry } from '@esri/telemetry';

// create options object
const opts = {
  requireConsent: true, // if your app requires privacy consent, set this to true
  plugins: [list of plugins goes in here]
};
// Host app should load user privacy settings from localStorage or cookies
const storedSettings = window.localStorage.getItem('esri_privacy_settings');
if (storedSettings) {
  opts.userPrivacySettings = JSON.parse(storedSettings);
} else {
  // this is optional, as telemetry.js will construct the same thing
  // if requiteConsent: true and not settings are passed in
  opts.userPrivacySettings = {
    id: '3ef...', // create some unique id
    timestamp: Date.now(),
    accepted: false, // user has not actually set these, so this is false
    performance: false, // all set to false by default 
    functional: false, 
    targeting: false,
  }
}
// create the telemetry instance
const telemetry = new Telemetry(opts);

await telemetry.init();
// now it is ready to go

In Server

Since this is done on the server, it is not able to take user privacy settings into account. Thus, it is discouraged to inject script tags on the server, as tracking is likely to start before the host application actually boots and can apply the user privacy settings.

import { Telemetry } from '@esri/telemetry';

// create options object
const opts = {
  plugins: [list of plugins goes in here]
};
// create the telemetry instance
const telemetry = new Telemetry(opts);
// in server
const scriptTags = telemetry.getScriptTags();
// now inject script tags into html page before sending it down

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.