npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

moleculer-segment

1.0.0 • Public • Published

Moleculer logo

moleculer-segment

Service for Segment.

Install

$ yarn add moleculer-segment

Usage

Add environment variable

SEGMENT_WRITE_KEY=12345

Identify, track, …

For identify an user

broker.call('segment.identify', {
  userId: '1234',
  traits: {
    // for example a name and an email
    name: 'Jean Dupont',
    email: 'jean@dupont.fr',
  }
})

For track an event

broker.call('segment.track', {
  userId: '1234',
  // you can an address ip
  ip: '8.8.4.4',
  properties: {
    'referer': 'action',
  }
})

Keywords

none

install

npm i moleculer-segment

Downloadsweekly downloads

4

version

1.0.0

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability