Socket
Socket
Sign inDemoInstall

@segment/facade

Package Overview
Dependencies
Maintainers
240
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@segment/facade

Providing common fields for analytics integrations


Version published
Maintainers
240
Created

What is @segment/facade?

@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.

What are @segment/facade's main functionalities?

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' }

Other packages similar to @segment/facade

FAQs

Package last updated on 10 Jan 2023

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