https://github.com/hex22a/jwt-redux-devtools
Redux middleware to develop JWT-based apps
https://github.com/hex22a/jwt-redux-devtools
Last synced: 5 months ago
JSON representation
Redux middleware to develop JWT-based apps
- Host: GitHub
- URL: https://github.com/hex22a/jwt-redux-devtools
- Owner: hex22a
- License: mit
- Created: 2017-05-14T22:12:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-05-13T09:57:27.000Z (about 1 year ago)
- Last Synced: 2025-10-04T01:58:51.000Z (9 months ago)
- Language: JavaScript
- Size: 240 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JWT Redux Devtools
[](https://travis-ci.org/hex22a/jwt-redux-devtools)
[](https://coveralls.io/github/hex22a/jwt-redux-devtools?branch=master)
Redux middleware to develop JWT-based apps
## Installation
`yarn add -D jwt-redux-devtools`
or `npm i --save-dev jwt-redux-devtools` if you are still using npm
## Usage
Import and add reducer
rootReducer.js
```javascript
import { combineReducers } from 'redux';
import { jwtReducer } from 'jwt-redux-devtools';
// something
export default combineReducers({
...jwtReducer,
});
```
Import middleware
configureStore.dev.js
```javascript
import { applyMiddleware, compose, createStore } from 'redux';
import jwtMiddleware from 'jwt-redux-devtools';
import rootReducer from '../rootReducer';
import actionTypes from '../actions/actionTypes';
// Action that contains token in payload
const { SIGN_IN_SUCCESS } = actionTypes;
// some of your code here
const enhancer = compose(
applyMiddleware(jwtMiddleware([SIGN_IN_SUCCESS])),
);
// and maybe here
export default createStore(rootReducer, {}, enhancer);
```
## Contributing
PR's are welcome 👍
## Credits
Maintained by [hex22a](http://github.com/hex22a)
Twitter: [@hex22a](https://twitter.com/hex22a)