New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

segment-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

segment-wrapper

This package provides a way of using [Segment](https://segment.com/) in a safe and secure way.

  • 1.2.5-alpha.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Segment Wrapper

This package provides a way of using Segment in a safe and secure way.

Getting started

$ yarn add @bulb/segment-wrapper

Using the wrapper

The wrapper replaces any use of Segment's .track, .page and .identify functions.

You can then you can use the normal Segment functions:

const adsTracker = new Tracker(adsOptions);

adsTracker.track('Clickable Clicked', { button: 'Switch Now' });

Integration options

You can specify the integrations either when constructing the instance of the tracker, or for a particular track/page/identify event. Integrations determine to which destination the events are sent to.

The package provides 2 preset integrations options:

  1. DataWarehousing options This is for internal tracking destinations, including BigQuery and Google Pub Sub

  2. Ads options This is for sharing events with third parties and ad partners, including Facebook Pixel and Google Ads.

You can also set custom integrations, however the flag All will always be reset to false to prevent the event going to all destinations.

You can construct the tracker with a preset set of integrations, but change the integrations for a particular event. In the below example, the event will still be sent to the other datawarehousing destinations Google Analytics and Google Cloud PubSub.

const dwTracker = new Tracker(dataWarehousingOptions);

dwTracker.track(
  'View Viewed',
  { page: 'Quote' },
  {
    integrations: {
      bigquery: false,
    },
  },
);

Preventing PII from being logged and shared

We should never log Personally Identifiable Information (PII) internally or share PII externally.

The tracker will console.warn if any keys in the object passed to the event properties are suspiciously named.

For example if an object with the key firstname is passed to a track event as its properties, there will be a warning.

FAQs

Package last updated on 31 Dec 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