redux-lytics
v1.3.0
Published
Redux middleware to track analytics
Downloads
3
Maintainers
Readme
Redux-lytics
Redux-lytics is a simple Redux middleware used to log events to a external service through HTTP POST requests.
Getting Started:
Install redux-lytics:
- NPM:
npm install redux-lytics
- Yarn:
yarn add redux-lytics
Usage:
// index.js
import { createLogger } from 'redux-lytics';
import { config, defaultHeaders } from './config';
const logger = createLogger(config, defaultHeaders);
const middleware = [logger];
// config.js
export const config = {
INCREMENT: {
url: "/analytics",
body: {'key': "hello"},
headers: {}
}
};
export const defaultHeaders = {
Accept: 'application/json'
};