Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
amplitude-js
Advanced tools
The amplitude-js npm package is a JavaScript library for integrating Amplitude's analytics platform into web applications. It allows developers to track user interactions, events, and behaviors to gain insights into user engagement and product usage.
Initialize Amplitude
This feature initializes the Amplitude instance with your API key, allowing you to start tracking events and user interactions.
const amplitude = require('amplitude-js');
amplitude.getInstance().init('YOUR_API_KEY');
Track Events
This feature allows you to log custom events with optional event properties. It helps in tracking specific user actions within your application.
amplitude.getInstance().logEvent('EVENT_NAME', { key: 'value' });
Identify Users
This feature sets a unique user ID for tracking individual users. It is useful for identifying and analyzing user-specific behaviors.
amplitude.getInstance().setUserId('USER_ID');
Set User Properties
This feature allows you to set custom properties for a user, which can be used for segmentation and more detailed analysis.
amplitude.getInstance().setUserProperties({ key: 'value' });
Revenue Tracking
This feature enables revenue tracking by logging transactions and purchases, helping you understand the financial impact of user actions.
const revenue = new amplitude.Revenue().setProductId('PRODUCT_ID').setPrice(9.99);
amplitude.getInstance().logRevenueV2(revenue);
Mixpanel is another popular analytics platform that offers similar functionalities to Amplitude, such as event tracking, user identification, and property setting. Mixpanel also provides advanced features like A/B testing and user retention analysis.
Google Analytics is a widely-used analytics service that tracks and reports website traffic. While it offers robust event tracking and user analysis features, it is more focused on web traffic and marketing analytics compared to Amplitude's product analytics.
Amplitude is introducing a new TypeScript SDK for Browser. This new SDK provides improved developer experience, helps users instrument data more seamlessly and provide more control over data being instrumented using custom plugins.
To learn more about the new SDK, here are some useful links:
A JavaScript SDK for tracking events and revenue to Amplitude.
Ampli SDK is autogenerated library based on your pre-defined tracking plan. The Ampli SDK, is a lightweight wrapper over the Amplitude SDK that provides type-safety, supports linting, and enables features like input validation. The code replicates the spec in the Tracking Plan and enforces its rules and requirements. This repository is about Amplitude SDK. To learn more about Ampli SDK, please refer to the Ampli Browser and examples.
As of >= v8.0.0, this SDK no longer has support for React Native. We recently released a new SDK focused on providing a React Native first approach to using Amplitude in cross-platform projects. Amplitude React Native SDK
Previously used amplitude-js and looking to migrate to @amplitude/react-native?
Please visit Amplitude-Node for our Node SDK.
Click here to view the JavaScript SDK Changelog.
The cookie format has been changed to be more compact. If you use the same Amplitude project(API key) across multiple applications, and you track anonymous users across those applications, you will want to update amplitude across all those applications at the same time. Otherwise these anonymous users will have a different device id in your different applications.
If you do not have multiple installations of amplitude, or if you do not track anonymous users across different installations of amplitude, this change should not affect you.
We stopped committing the generated amplitude.min.js and amplitude.js files to
the repository. This should only affect you if you load amplitude via github.
You should use npm
or yarn
instead.
We dropped our custom symbian and blackberry user agent parsing to simply match what the ua-parser-js library does.
The library now defaults to sending requests to https://api.amplitude.com instead of //api.amplitude.com. This should only affect you if your site does not use https and you use a Content Security Policy.
If you have any problems or issues over our SDK, feel free to create a github issue or submit a request on Amplitude Help.
FAQs
Javascript library for Amplitude Analytics
The npm package amplitude-js receives a total of 176,224 weekly downloads. As such, amplitude-js popularity was classified as popular.
We found that amplitude-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.