Since
v2
Segment now has it's own well-maintained library written using TypeScript.Please check the original repository for the details.
Just another alternative of library for Segment analytics, written on TypeScript.
import segment from 'segment-analytics-web';
segment.initialize('your-segment-api-key');
segment.analytics.identify('97980cfea0067', {
name: 'Woof Bark'
});
// window.analytics should be also available
- Loading options
- Fully typed methods
- Tests