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

@asayerio/js

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asayerio/js

The Asayer tracker

  • 1.1.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by900%
Maintainers
3
Weekly downloads
 
Created
Source

Asayer JS

A component to load Asayer snippet inside your bundle. This method is best suited for modern web applications which keeps code cleaner and saves loading time.

Installation

npm i @asayerio/js --save

Usage

Initialize the package from your codebase entry point. This would start the Asayer tracking snippet. SITE_ID can be found in your Asayer dashboard after clicking on Tracking Code under Preferences -> Sites.

import { init } from '@asayerio/js';

init({
  siteID: SITE_ID,
});

Then you can use Asayer JavaScript API anywhere in your code.

import asayer from '@asayerio/js';

asayer.vars('userId', 'my_custom_user_id');

Also, there is the set of additional methods available when using the package

fetch

In order to write down the payload of the requests and responses, and simplify the integration with backend logs, you can use our wrapper over the fetch

import { init, fetch } from '@asayerio/js';

init({ siteID: XXX, fetch: { sessionIDHeader: 'X-SessionID' } }); // header name for sessionID (optional)

fetch('http://example.com/movies.json')
  .then(...)

profiler

To measure the performance of specific part of your code you can use profiler call

import { profiler } from '@asayerio/js';

var fn = profiler('call_name')(function () {
  ...
}, thisArg); // thisArg is optional

Keywords

FAQs

Package last updated on 10 Dec 2019

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