
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
generics-axios
Advanced tools
generics-axios is a custom hook for Axios with generics support. It simplifies the use of Axios requests by providing type-safe API calls with TypeScript.
AxiosProvider.AxiosError type.npm install generics-axios
yarn add generics-axios
bun add generics-axios
// App.tsx or your main entry component
import React from 'react';
import { AxiosProvider } from 'generics-axios';
import { AppContent } from './AppContent';
const App = () => {
const defaults = {
defaultReturn: { status: '', status: '' }, // Default return when no data
defaultError: { message: 'An error occurred' }, // Default error response
headerDefault: { 'Authorization': 'Bearer token' } // Default headers
};
return (
<AxiosProvider defaults={defaults}>
<AppContent />
</AxiosProvider>
);
};
export default App;
import { isAxiosError } from "axios";
const Main = () => {
const { execute } = useAxios<'GET', 'DEFAULT'>(
{ method: 'GET', url: 'https://jsonplaceholder.typicode.com/todos/1' },
true // Use default return value
);
const fetchData = async () => {
const res = await execute()
if(isAxiosError(res)) {
const error = res.response.data.error
} else {
console.log(res)
}
}
}
export default Main
export const fetchData = async () => {
const config = {
method: 'GET',
url: 'https://jsonplaceholder.typicode.com/todos/1',
};
const { execute } = await axiosService(config);
return execute();
};
FAQs
A custom hook for Axios wicle th generics support
We found that generics-axios demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.