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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fastly/insights.js

v3.1.0

Published

Real user monitoring

Downloads

33

Readme

Insights.js Travis Build Status

Real user monitoring

Quick links

Installation

Requirements

  • Node.js >= 6 (brew install node)

Install

git clone [email protected]:fastly/insights.js.git
cd insights.js
npm install
npm run build

Running

Most actions you'd like to perform whilst developing insights.js are defined as NPM scripts tasks and can be invoked using npm run {task}.

A list of all commands and their description can be found below.

Name | Description -----------------------|----------------------------- build | Compiles the application for production environments build:dev | Compiles the application for development lint | Lints the source files for style errors using ESLint and automatically formats the source files using prettier test | Runs the linting and unit test suite test:once | Runs the unit test suite once with coverage output test:watch | Runs the unit test suite in watch mode start | Runs the development server in watch mode

FAQ

What is it?

Fastly Insights is an optional service deployed by some Fastly customers for network and performance monitoring and research purposes. It does not collect any personal data. We are only interested in your network, to make the internet work better.

The JavaScript library is built using the Open Insights framework. We collect information about HTTP and HTTPS network transactions, including: network routing, performance timing, and equipment characteristics. Measurements are recorded to analyze the performance of the Fastly network and overall state of the internet.

Insights.js is served via Fastly’s CDN. All collected data is sent back to the Fastly Insights service and log streamed using Fastly’s log streaming to a Fastly managed data warehouse for subsequent analysis.

How does it work?

The library is deployed to websites via a JavaScript <script> tag, such as:

<script defer src="https://www.fastly-insights.com/insights.js?k=1111-2222-3333"></script>  

In the above tag, k is an API token that identifies the host website to Fastly. The script contains code to load and execute a minimal task runner application. All tasks are run as low-priority requests and are designed not to interfere with the user's current page navigation or alter the host page’s Document Object Model (DOM) in any way, to prevent it from accessing first-party data on the page or affecting page load performance.

Each task fetches one or more objects from the network and gathers timing information associated with the request (using the ResourceTiming API) and any other browser information required by the task. See below for the full list of task types.

The results of each task are normalized (such as IP anonymization, see full list of task types for further information regarding normalization) and the data is then beaconed back to the Fastly Insights service via a POST request to fastly-insights.com/beacon.

The service then adds additional data available from Fastly’s standard logging variables related to the network request and logs all final data to a Fastly managed data warehouse.

Request flow

Request flow

  1. Page load.
  2. Fetches configuration from Fastly Insights service.
  3. Tasks are executed (see also: full list of task types and data collected):
    1. Network requests made to test objects.
    2. Task information recorded on the client.
  4. Task information is beaconed back to the Fastly Insights service.
  5. Additional information is recorded at the Fastly Insights service before ingestion.
  6. Information collected in step 3 and 5 is logged to a Fastly managed data warehouse for post-processing.

What type of information does Fastly Insights collect?

The following table lists each of the possible tasks Fastly Insights may run on a host web page:

*Note: Client data is collected on the client within a browser and Request metadata is collected on the Fastly Insights service.

What does Fastly use Fastly Insights information for?

Fastly uses the data collected to identify trends and performance heuristics for clients interacting with Fastly and its services. Fastly's use, and potential disclosure, of the data includes:

  • Monitoring Fastly’s network and performance
  • Improving the accuracy of DNS query answers
  • Improving Fastly's capacity and network planning
  • A/B testing and comparison of the performance of new technologies to improve Fastly services
  • Research initiatives to inform technology decisions
  • Research initiatives to inform case studies
  • Research initiatives for academic purposes and to feed back to the wider community
  • Responding to performance and other related inquiries from Fastly’s customers

Privacy concerns

As described above in this FAQ, the information collected is statistical data and does not include personally identifiable data. Client IP addresses are truncated, and user-agent strings normalized before ingestion. See the full list of task types for a list of data collected.

Fastly Insights does not read or write any data to persistent storage in the browser, which includes cookies. Fastly Insights does not interact with cookies. We do not store any information across browsing sessions.

We may retain the raw information collected from individual Fastly Insights sessions for up to one year. We may retain aggregate information indefinitely.

Fastly’s commitment to transparency

Any changes to this FAQ document and the data we collect over time will be logged in our change log.

Community Support

License

MIT