redux-reporter
Advanced tools
Comparing version 0.0.8 to 0.0.9
{ | ||
"name": "redux-reporter", | ||
"version": "0.0.8", | ||
"description": "Redux middleware for reporting actions to third party APIs.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "rm -rf lib/ && babel src --babelrc true --out-dir lib", | ||
"prepublish": "npm run build", | ||
"test": "./node_modules/.bin/mocha test/**/*.test.js", | ||
"lint": "eslint src" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ezekielchentnik/redux-reporter.git" | ||
}, | ||
"homepage": "https://github.com/ezekielchentnik/redux-reporter", | ||
"keywords": [ | ||
"redux", | ||
"middleware", | ||
"redux-middleware", | ||
"adobe dtm", | ||
"name": "redux-reporter", | ||
"version": "0.0.9", | ||
"description": "Redux middleware for reporting actions to third party APIs.", | ||
"main": "dist/bundle.umd.js", | ||
"jsnext:main": "dist/bundle.es.js", | ||
"scripts": { | ||
"build": "rm -rf dist/ && rollup -c", | ||
"prepublish": "npm run build", | ||
"test": "", | ||
"lint": "standard" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ezekielchentnik/redux-reporter.git" | ||
}, | ||
"homepage": "https://github.com/ezekielchentnik/redux-reporter", | ||
"keywords": [ | ||
"new relic", | ||
"crash reporter", | ||
"analytics" | ||
], | ||
"author": "Ezekiel Chentnik <zeek@ezekielchentnik.com>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"babel-cli": "6.10.1", | ||
"babel-plugin-transform-object-assign": "6.8.0", | ||
"babel-plugin-transform-object-rest-spread": "6.8.0", | ||
"babel-plugin-transform-runtime": "6.9.0", | ||
"babel-preset-es2015": "6.9.0", | ||
"chai": "3.3.0", | ||
"eslint": "3.1.0", | ||
"mocha": "2.3.3", | ||
"sinon": "1.17.1" | ||
}, | ||
"dependencies": { | ||
"flux-standard-action": "0.6.1" | ||
} | ||
"sentry", | ||
"keen", | ||
"segment", | ||
"redux", | ||
"middleware", | ||
"redux-middleware", | ||
"adobe dtm", | ||
"crash reporter", | ||
"analytics" | ||
], | ||
"author": "Ezekiel Chentnik <zeek@ezekielchentnik.com>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"rollup": "0.36.4", | ||
"rollup-plugin-buble": "0.14.0", | ||
"standard": "8.6.0", | ||
"tape": "4.6.3" | ||
} | ||
} |
110
README.md
@@ -15,3 +15,3 @@ # redux-reporter | ||
#### Generic Reporting | ||
### General Reporting | ||
Create your reporting middleware | ||
@@ -66,6 +66,6 @@ ```js | ||
``` | ||
Reporting to Multiple APIs: | ||
You can report to multiple APIs by configuring multiple middlewares and attaching additional attributes to your actions | ||
```js | ||
#### Analytics | ||
This example uses Adobe DTM, but this pattern will work for other APIs (keen, segment, etc.) | ||
```js | ||
// /actions/MyActions.js | ||
@@ -77,9 +77,10 @@ export function myAction() { | ||
meta: { | ||
analytics: { | ||
type, | ||
payload: { | ||
userType: 'example', | ||
someOtherData: '1234' | ||
} | ||
} | ||
analytics: { | ||
type, | ||
payload: 'example payload' | ||
}, | ||
experiments: { | ||
type, | ||
payload: 'example payload' | ||
} | ||
} | ||
@@ -89,24 +90,8 @@ }; | ||
// /middleware/adobedtm.js | ||
import reporter from 'redux-reporter'; | ||
// create custom select function to select desired slice of your action | ||
const select = ({ meta = {} }) => meta.analytics; | ||
export default reporter(({ type, payload }) => { | ||
try { | ||
window._satellite.setVar('payload', payload); | ||
window._satellite.track(type); | ||
} catch (err) {} | ||
}, select); | ||
// inside Adobe DTM we create a direct call rule with the same name/condition as our action type | ||
``` | ||
## New Relic | ||
## [New Relic](https://newrelic.com/) | ||
#### error reporting | ||
### error reporting | ||
@@ -137,3 +122,3 @@ ```js | ||
#### analytics reporting | ||
### User behavior (New Relic browser/insights) | ||
@@ -165,26 +150,2 @@ ```js | ||
## Reporting to Multiple APIs | ||
You can report to multiple APIs by configuring multiple middlewares and attaching multiple attributes to your actions | ||
```js | ||
// /actions/MyActions.js | ||
export function myAction() { | ||
let type = 'MY_ACTION'; | ||
return { | ||
type, | ||
meta: { | ||
analytics: { | ||
type, | ||
payload: 'example payload' | ||
}, | ||
experiments: { | ||
type, | ||
payload: 'example payload' | ||
} | ||
} | ||
}; | ||
} | ||
``` | ||
## Optimizely | ||
@@ -219,4 +180,39 @@ redux-reporter can be used for goal tracking with optimizely | ||
``` | ||
## Todo | ||
- Add examples: using global state, Sentry | ||
- Add tests | ||
## Adobe DTM (direct call rules) | ||
You can also report to an Analytics provider. This example uses Adobe DTM, but this pattern will work for other APIs (keen, segment, etc.) | ||
```js | ||
// /actions/MyActions.js | ||
export function myAction() { | ||
let type = 'MY_ACTION'; | ||
return { | ||
type, | ||
meta: { | ||
analytics: { | ||
type, | ||
payload: { | ||
userType: 'example', | ||
someOtherData: '1234' | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
// /middleware/adobedtm.js | ||
import reporter from 'redux-reporter'; | ||
// create custom select function to select desired slice of your action | ||
const select = ({ meta = {} }) => meta.analytics; | ||
export default reporter(({ type, payload }) => { | ||
try { | ||
window._satellite.setVar('payload', payload); | ||
window._satellite.track(type); | ||
} catch (err) {} | ||
}, select); | ||
// inside Adobe DTM we create a direct call rule with the same name/condition as our action type | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11535
0
4
10
124
2
212
1
- Removedflux-standard-action@0.6.1
- Removedflux-standard-action@0.6.1(transitive)
- Removedlodash._basefor@3.0.3(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.isplainobject@3.2.0(transitive)
- Removedlodash.keysin@3.0.8(transitive)