Redux sentry
Includes middleware that logs all your store and actions on exception to Sentry with raven-js
Table of Contents
Installation
Install redux-sentry
package from npm:
npm i --save redux-sentry
Usage
redux-sentry
can be used in cases:
- Raven has been initialized before
/* store.js */ ; ; ; const sentryMiddleware = ; // Add sentry middleware to your list of middlewaresconst middlewares = sentryMiddleware ; // Enhance your store by using sentry's enhancerconst toEnhance = ; // Put it all togetherconst enhancer = ;const reducers = ; const initialState = {} const store = ; ;
- Raven hasn't been initialized. It should be configured by params
/* store.js */ ; ; ; const sentryMiddleware = ; // Add sentry middleware to your list of middlewaresconst middlewares = sentryMiddleware ; // Enhance your store by using sentry's enhancerconst toEnhance = ; // Put it all togetherconst enhancer = ;const reducers = ; const initialState = {} const store = ; ;
API
createSentryMiddleware({ dsn, configuration = {}, username }, transform = {})
;
Middleware that logs all your store and actions on exception to Sentry with raven-js
dsn
{String}
DSN
– Data Source Name. Unique name generated for the project by you Sentry.
configuration
{Object} optional
Raven configuration object. Full list of keys can be found here.
username
{String} optional
Default: Guest
username
used for setting user context.
Raven;
transform
{Object} optional
Default:
a a
Functions used for cooking action object, store for Raven's extra
field.
stateTransform
uses toJS from immutable.js to convert state back to raw JavaScript object.
Contributing
- Provide conventional commit messages by using
npm run commit
instead ofgit commit
. - Core contributors: use GitHub's Rebase and merge as a default way of merging PRs.
License
MIT © AuRu