Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@cicara/react-axios
Advanced tools
React Axios is a React library based on Axios that aims to provide better HTTP request handling capabilities for React applications. The library provides an AxiosProvider component that makes it easy to use Axios throughout your entire React application, and includes a useAxios hook and some customizable interceptors.
npm install @cicara/react-axios
To use Axios in your React components, you need to provide an AxiosProvider component in your application. In the AxiosProvider component, you can set the configuration for the Axios instance, and add interceptors for custom handling.
import { useEffect } from "react";
import { useAxios, AxiosProvider } from "@cicara/react-axios";
function TestAxios() {
const axios = useAxios();
useEffect(
() => {
const ac = new AbortController();
// GET request to `/base/url/test?_t=1682750920279`
axios.get("/test", { signal: ac.signal })
.catch((err) => {
console.error(err);
});
return () => {
ac.abort();
};
},
[axios],
);
return (
<div>Axios Test</div>
);
}
export default function App() {
return (
<AxiosProvider
config={{
baseURL: "/base/url"
}}
interceptors={[
{
name: "timestamp",
request: {
onFulfilled(request) {
request.params = {
_t: Date.now(),
...request.params,
};
return request;
}
}
}
]}>
<TestAxios />
<AxiosProvider
config={{
baseURL: "/base/url2"
}}
interceptors={[
{
name: "auth",
request: {
onFulfilled(request) {
request.headers.Authorization = `Bearer ${localStorage.getItem('token')}`;
return request;
}
}
}
]}>
<TestAxios />
</AxiosProvider>
</AxiosProvider>
);
}
FAQs
react axios wrapper
The npm package @cicara/react-axios receives a total of 5 weekly downloads. As such, @cicara/react-axios popularity was classified as not popular.
We found that @cicara/react-axios 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.