Service for Segment.
$ yarn add moleculer-segment
SEGMENT_WRITE_KEY=12345
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',
}
})