Socket
Book a DemoInstallSign in
Socket

@sho-js/analytics

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sho-js/analytics

## Installation

6.0.2
latest
Source
npmnpm
Version published
Weekly downloads
3
50%
Maintainers
2
Weekly downloads
 
Created
Source

Wearesho Analytics

Installation

npm i --save @sho-js/analytics

Usage

Setup

Create instance of WeareshoAnalytics.Service with following params:

import * as WeareshoAnalytics from "@sho-js/analytics";

const axiosInstance = Axios.create({baseURL: "https://wearesho.public.api.com/"});

const token = ""; // your way to receive unique fingerprint value
const components = {
    resolution: "1920,1080",
    offset: 3,
    // ... other key/value pairs
};

const fingerPrint: FingerPrint = { token, components }

const analytics = await WeareshoAnalytics.Service.create(axiosInstance, fingerPrint);

where

  • axiosInstance - instance of Axios. Required.
  • fingerPrint - fingerprint data. Required.

Actions

analytics.action("some unique action name");
analytics.input("fieldName", ["valuePrev", "valueNext"]);
analytics.user(1 /* UserId */);

Helpers

const actionHandler = analytics.handler(analytics.action, "some unique action name");
const inputHandler = analytics.handler(analytics.input, "fieldName", ["valuePrev", "valueNext"]);
const userHandler = analytics.handler(analytics.input, 1);

<button onClick={actionHandler}/>
<button onClick={inputHandler}/>
<button onClick={userHandler}/>

Keywords

analytics

FAQs

Package last updated on 06 Mar 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.