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

redux-reporter

Package Overview
Dependencies
Maintainers
2
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.1.1 to 0.1.2

yarn.lock

6

dist/bundle.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.reduxReporter = global.reduxReporter || {})));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.reduxReporter = global.reduxReporter || {})));
}(this, (function (exports) { 'use strict';

@@ -6,0 +6,0 @@

{
"name": "redux-reporter",
"version": "0.1.1",
"version": "0.1.2",
"description": "Redux middleware for reporting actions to third party APIs.",

@@ -31,7 +31,7 @@ "main": "dist/bundle.umd.js",

"devDependencies": {
"rollup": "0.36.4",
"rollup-plugin-buble": "0.14.0",
"standard": "8.6.0",
"rollup": "0.42.0",
"rollup-plugin-buble": "0.15.0",
"standard": "10.0.2",
"tape": "4.6.3"
}
}

@@ -89,3 +89,3 @@ # redux-reporter

## [New Relic](https://newrelic.com/)
## Example w/ [New Relic](https://newrelic.com/)

@@ -144,69 +144,1 @@ ### error reporting

```
## Optimizely
redux-reporter can be used for goal tracking with optimizely
```js
// /middleware/optimizely.js
import reporter from 'redux-reporter';
export default reporter(({ type, payload }) => {
window.optimizely = window.optimizely || [];
window.optimizely.push(['trackEvent', type, payload]);
}, ({ meta = {} }) => meta.experiments);
// /actions/MyActions.js
export function myAction() {
let type = 'MY_ACTION';
return {
type,
meta: {
experiments: {
type,
payload: 'example payload'
}
}
};
}
```
## 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
```

Sorry, the diff of this file is not supported yet

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