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

@arcblock/analytics-js

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/analytics-js

Analytics Javascript SDK for API Service by ArcBlock

  • 0.19.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@arcblock/analytics-js

build status code coverage styled with prettier license

Analytics Javascript SDK for ArcBlock for both Node.js and Browser

If you are using this SDK in browser environment, babel-polyfill is required.

Table of Contents

Install

npm install @arcblock/analytics-js
// or
yarn add @arcblock/analytics-js

Usage

In Browser

const SDK = require('@arcblock/analytics-js');

// init client
SDK.initialize('ocap_playground');

// set param
SDK.set('userId', 123455);

// all param values are converted to underscore_case
const result = await SDK.event({
  category: 'interaction', // only `activity` and `interaction` supported
  action: 'click',
  type: 'button',
  label: 'run_query',
  data: {},
});

const result2 = await SDK.pageview('/');
Browser Compatibility

TO BE DONE

In Node.js

Usually on server side

const express = require('express');
const ABA = require('@arcblock/analytics-js');

const app = express();

app.use(ABA.initializeExpress('ocap_widget'));
app.use(async (req, res, next) => {
  // in production, you should not wait for event sending complete
  const result = await req.ABA.event({
    category: 'activity', // only `activity` and `interaction` supported
    action: 'submit',
    type: 'order',
    label: '123456',
    data: {},
  });

  res.jsonp(result);
});

app.listen(3000, () => console.log('server started'));

Keywords

FAQs

Package last updated on 30 May 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