Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/winoteam-archives/moleculer-segment

Moleculer service for Segment
https://github.com/winoteam-archives/moleculer-segment

analytics moleculer segment

Last synced: 2 months ago
JSON representation

Moleculer service for Segment

Awesome Lists containing this project

README

        

![Moleculer logo](http://moleculer.services/images/banner.png)

# moleculer-segment

Service for [Segment](http://segment.com).

# Install

```bash
$ 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: '[email protected]',
}
})
```

For track an event

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