
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@arcblock/analytics-js
Advanced tools
Analytics Javascript SDK for ArcBlock for both Node.js and Browser
If you are using this SDK in browser environment, babel-polyfill is required.
npm install @arcblock/analytics-js
// or
yarn add @arcblock/analytics-js
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('/');
TO BE DONE
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'));
FAQs
Analytics Javascript SDK for API Service by ArcBlock
The npm package @arcblock/analytics-js receives a total of 0 weekly downloads. As such, @arcblock/analytics-js popularity was classified as not popular.
We found that @arcblock/analytics-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.