Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/winoteam-archives/moleculer-segment
- Owner: winoteam-archives
- License: mit
- Archived: true
- Created: 2018-12-17T14:10:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-17T14:52:20.000Z (about 6 years ago)
- Last Synced: 2024-08-17T20:57:12.799Z (5 months ago)
- Topics: analytics, moleculer, segment
- Language: TypeScript
- Homepage:
- Size: 38.1 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-moleculer - moleculer-segment - Service for [Segment](https://segment.com/) (Services / Others)
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',
}
})
```