axios-encrypt
v0.0.1
Published
Axios plugin for encrypting your requests.
Downloads
53
Readme
Axios plugin for encrypting your requests.
At the moment library encrypts only body of requests.
Install
yarn add axios-encrypt
or
npm i -S axios-encrypt
Usage
Connect example:
import axios from 'axios'
import { applyEncryptToAxios } from 'axios-encrypt'
import CryptoJS from 'crypto-js'
const apiClient = axios.create({})
applyEncryptToAxios(apiClient, {
onEncrypt(str: string): string {
let encrypted = CryptoJS.AES.encrypt(str, 'secret')
return encrypted.toString()
},
})
Works with: