Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@asayerio/tracker-fetch

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asayerio/tracker-fetch

Tracker plugin for fetch requests recording

  • 5.7.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
3
Weekly downloads
 
Created
Source

Asayer Tracker Fetch plugin

Tracker plugin to support tracking of the fetch requests payload. Additionally it populates the requests with sessionID header for backend logging.

Installation

npm i @asayerio/tracker-fetch

Usage

Initialize the @asayerio/tracker package as usual and load the plugin into it. Then you can use the provided fetch method from the plugin instead of built-in.

import Tracker from '@asayerio/tracker';
import trackerFetch from '@asayerio/tracker-fetch';

const tracker = new Tracker({
  projectID: PROJECT_ID,
});
tracker.start();

export const fetch = tracker.use(trackerFetch({
  sessionTokenHeader: 'X-Session-ID', // optional
  failuresOnly: true //optional
}));

fetch('https://api.asayer.io/').then(response => console.log(response.json()));

In case you use Asayer integrations (sentry, bugsnag or others), you can use sessionTokenHeader option to specify the header name. This header will be appended automatically to the each fetch request and will contain Asayer session identificator value.

Set failuresOnly option to true if you want to record only requests with the status code >= 400.

Keywords

FAQs

Package last updated on 22 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc