1.1.17 • Published 4 years ago

@asayerio/js v1.1.17

Weekly downloads
24
License
MIT
Repository
github
Last release
4 years ago

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
1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago