
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.
@simple-api/react-native
Advanced tools
The mobile-optimized adapter for simple-api.
@simple-api/react-native is a specialized wrapper around @simple-api/react, specifically tuned for the mobile environment. It ensures that your API engine performs optimally on iOS and Android devices, focusing on battery efficiency and shared logic.
npm install @simple-api/react-native @simple-api/core @tanstack/react-query
One of the greatest strengths of simple-api is sharing your API definition between Web and Mobile:
// shared/api.ts
import { createApi } from "@simple-api/core";
export const apiDefinition = createApi({
baseUrl: "https://api.myapp.com",
services: {
auth: {
login: { method: "POST", path: "/auth/login" },
},
content: {
list: { method: "GET", path: "/items" },
},
},
});
// hooks/useApi.ts (Mobile Project)
import { createReactAdapter } from "@simple-api/react-native";
import { apiDefinition } from "../shared/api";
export const useMobileApi = createReactAdapter(apiDefinition);
import React from "react";
import { View, Text, ActivityIndicator } from "react-native";
import { useMobileApi } from "../hooks/useApi";
export const FeedScreen = () => {
const { content } = useMobileApi();
const { data, isLoading, error } = content().list();
if (isLoading) return <ActivityIndicator color="#0000ff" />;
if (error) return <Text>Error loading items</Text>;
return (
<View>
{data.map((item) => (
<Text key={item.id}>{item.title}</Text>
))}
</View>
);
};
Mobile networks are often flaky. We recommend using the createRetryMiddleware in your core definition:
import { createRetryMiddleware } from "@simple-api/core";
// In your shared api definition:
middleware: [createRetryMiddleware({ maxRetries: 3 })];
Use hookOptions in your screens to control how long data stays in memory:
content().list({
hookOptions: {
staleTime: 1000 * 60 * 5, // 5 minutes
gcTime: 1000 * 60 * 60, // Keep in memory for 1 hour
},
});
When a user navigates away from a screen, this adapter (powered by TanStack Query) automatically cancels pending network requests using AbortController, ensuring your app stays responsive and battery-efficient.
MIT © Elnatan Samuel
FAQs
React Native adapter for SimpleAPI Engine
The npm package @simple-api/react-native receives a total of 3 weekly downloads. As such, @simple-api/react-native popularity was classified as not popular.
We found that @simple-api/react-native 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
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.