Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-reporter

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-reporter - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

dist/bundle.es.js

74

package.json
{
"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"
}
}

@@ -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
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc