Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@segment/facade
Advanced tools
@segment/facade is a library that provides a set of utility functions to handle and manipulate analytics data. It is commonly used to normalize and transform data from various analytics sources into a consistent format.
Track
The Track feature allows you to create and manipulate track events, which are used to record actions that users perform.
const Track = require('@segment/facade').Track;
const track = new Track({
event: 'User Signup',
properties: {
plan: 'Pro',
referrer: 'Google'
}
});
console.log(track.event()); // 'User Signup'
console.log(track.properties()); // { plan: 'Pro', referrer: 'Google' }
Identify
The Identify feature allows you to create and manipulate identify events, which are used to associate user data with a specific user ID.
const Identify = require('@segment/facade').Identify;
const identify = new Identify({
userId: '12345',
traits: {
email: 'user@example.com',
name: 'John Doe'
}
});
console.log(identify.userId()); // '12345'
console.log(identify.traits()); // { email: 'user@example.com', name: 'John Doe' }
Page
The Page feature allows you to create and manipulate page events, which are used to record page views and related properties.
const Page = require('@segment/facade').Page;
const page = new Page({
name: 'Home',
properties: {
title: 'Homepage',
url: 'https://example.com'
}
});
console.log(page.name()); // 'Home'
console.log(page.properties()); // { title: 'Homepage', url: 'https://example.com' }
analytics-node is a library for sending data to Segment's tracking API. It provides similar functionality to @segment/facade but is more focused on sending data to Segment rather than manipulating it.
amplitude-js is a library for sending event data to Amplitude, a product analytics platform. It provides similar event tracking and user identification features but is specific to the Amplitude service.
Facade provides common fields for analytics integrations. Wraps the Segment.io API for use on the server or client.
See auto-generated documentation at facade.segment.com.
Make a pull request as usual. Be sure to update documentation if appropriate. If you've updated the JSDoc for any of the functions, please run:
$ make docs
Include resulting changes to the docs/
directory in your pull request.
Include them in a separate commit, so that your actual code/doc changes are
easy to distinguish.
Released under the MIT license.
FAQs
Providing common fields for analytics integrations
The npm package @segment/facade receives a total of 274,963 weekly downloads. As such, @segment/facade popularity was classified as popular.
We found that @segment/facade demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 240 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.