Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anishmprasad/react-segment
Segment integration for react
https://github.com/anishmprasad/react-segment
analytics analytics-tracking react segment segmentio
Last synced: 7 days ago
JSON representation
Segment integration for react
- Host: GitHub
- URL: https://github.com/anishmprasad/react-segment
- Owner: anishmprasad
- License: mit
- Created: 2017-07-24T09:28:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-31T18:17:43.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T18:57:25.565Z (15 days ago)
- Topics: analytics, analytics-tracking, react, segment, segmentio
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 9
- Watchers: 2
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-segment
Segment.io integration for React.js### Installation
```
// with npm
$ npm install react-segment --save// with yarn
$ yarn add react-segment
```Getting started
---------------If you're developing using npm and CommonJS modules:
```jsx
let analytics = require('react-segment');if(process.env.NODE_ENV == 'development'){
analytics.default.load("DEVELOPMENT KEY");
}else if(process.env.NODE_ENV == 'staging' ){
analytics.default.load("STAGING KEY");
}else if(process.env.NODE_ENV == 'pre-production'){
analytics.default.load("PRE-PRODUCTION KEY");
}else if(process.env.NODE_ENV == 'production'){
analytics.default.load("PRODUCTION KEY");
}
```Don't see your prop? explaining your use case, and I will add it.
Issues
------
Please [file an issue](https://github.com/anishmprasad/react-segment/issues) if you find a bug, or need help.License
-------
The MIT License (MIT)Copyright (c) 2022 Anish M Prasad