Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
raven-for-redux
Advanced tools
Note: Raven 3.14.0 has a bug (https://github.com/getsentry/raven-js/issues/925) which this library triggers.
Logs the type of each dispatched action to Raven as "breadcrumbs" and attaches your last action and current Redux state as additional context.
Inspired by redux-raven-middleware but with a slightly different approach.
npm install --save raven-for-redux
// store.js
import Raven from "raven-js";
import { createStore, applyMiddleware } from "redux";
import createRavenMiddleware from "raven-for-redux";
import { reducer } from "./my_reducer";
// Or, you might already have Raven as `window.Raven`.
Raven.config("<YOUR_DSN>").install();
export default createStore(
reducer,
applyMiddleware(
// Middlewares, like redux-thunk` that intercept or emit actions should
// preceed raven-for-redux.
createRavenMiddleware(Raven)
)
);
This library makes, what I think are, a few improvements over
redux-raven-middlware
:
<script>
tag.createRavenMiddleware(Raven, [options])
Raven
(Raven Object): A configured and "installed"
Raven object.options
] (Object): See below for detailed documentation.While the default configuration should work for most use cases, Raven for Redux can be configured by providing an options object with any of the following optional keys.
breadcrumbDataFromAction
(Function)Default: action => undefined
Raven allows you to attach additional context information to each breadcrumb in
the form of a data
object. breadcrubmDataFromAction
allows you to specify
a transform function which is passed the action
object and returns a data
object.
The default implementation of this function returns undefined
, which means no
data is attached. This is because there are a few gotchas:
Be careful not to mutate your action
within this function.
See the Sentry Breadcrumb documentation.
actionTransformer
(Function)Default: action => action
In some cases your actions may be extremely large, or contain sensitive data.
In those cases, you may want to transform your action before sending it to
Sentry. This function allows you to do so. It is passed the last dispatched
action
object, and should return a serializable value.
Be careful not to mutate your action
within this function.
If you have specified a dataCallback
when you configured Raven, note that
actionTransformer
will be applied before your specified dataCallback
.
stateTransformer
Default: state => state
(Function)
In some cases your state may be extremely large, or contain sensitive data. In those cases, you may want to transform your state before sending it to Sentry. This function allows you to do so. It is passed the current state object, and should return a serializable value.
Be careful not to mutate your state
within this function.
If you have specified a dataCallback
when you configured Raven, note that
stateTransformer
will be applied before your specified dataCallback
.
breadcrumbCategory
(String)Default: "redux-action"
Each breadcrumb is assigned a category. By default all action breadcrumbs are
given the category "redux-action"
. If you would prefer a different category
name, specify it here.
dispatch
function's) return value. (#11)actionTransformeri
and stateTransformer
are only run when reporting an error, rather than on every action. (#8)FAQs
Middleware for propagating Redux state/actions to Sentry via Raven.
The npm package raven-for-redux receives a total of 2,487 weekly downloads. As such, raven-for-redux popularity was classified as popular.
We found that raven-for-redux demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.