
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@simple-api/react
Advanced tools
Production-grade TanStack Query adapter for simple-api.
@simple-api/react provides a seamless bridge between your API definitions and React components. It automatically generates type-safe hooks for every endpoint, with built-in support for mutations, wildcard query invalidation, and global synchronization.
api.users().get()).invalidates: ['users/*'].isPending, isError, etc.).npm install @simple-api/react @simple-api/core @tanstack/react-query
import { createApi } from "@simple-api/core";
import { createReactAdapter } from "@simple-api/react";
const api = createApi({
baseUrl: "https://api.example.com",
services: {
users: {
get: { method: "GET", path: "/users/:id" },
update: { method: "PATCH", path: "/users/:id" },
},
},
});
export const useApi = createReactAdapter(api);
export const UserProfile = ({ id }) => {
const { users } = useApi();
const { data, isLoading } = users().get({ params: { id } });
if (isLoading) return <div>Loading...</div>;
return <h1>{data.name}</h1>;
};
The adapter supports wildcard invalidation strings to clear complex cache segments easily.
const { execute } = users().update({
params: { id: "123" },
invalidates: ["users/*"], // Invalidates every query in the 'users' service
});
Standard TanStack Query options can be passed via hookOptions.
users().get({
params: { id },
hookOptions: {
staleTime: 600000,
gcTime: 3600000,
enabled: !!id,
},
});
MIT © Elnatan Samuel
FAQs
React TanStack Query adapter for SimpleAPI Engine
The npm package @simple-api/react receives a total of 8 weekly downloads. As such, @simple-api/react popularity was classified as not popular.
We found that @simple-api/react demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.