native-data-fetching

Implement and debug network requests and API calls in Expo applications.

7|2|Updated May 11, 2023
One-click install
npx skills add https://github.com/vitalyiegorov/suuudokuuu --skill native-data-fetching-vitalyiegorov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: native-data-fetching
Source: https://github.com/vitalyiegorov/suuudokuuu/tree/main/.agents/skills/native-data-fetching
Command: npx skills add https://github.com/vitalyiegorov/suuudokuuu --skill native-data-fetching-vitalyiegorov

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the implementation and debugging of all network requests, API calls, and data fetching within an Expo application, ensuring robust and efficient data handling.

Core Features & Use Cases

  • API Request Implementation: Set up GET, POST, and other HTTP methods using fetch or libraries like React Query.
  • Data Fetching & Caching: Configure strategies for fetching data efficiently, including caching with React Query and SWR.
  • Error Handling & Debugging: Implement comprehensive error handling for network failures and HTTP errors, including retry logic.
  • Authentication: Manage API tokens securely using expo-secure-store and implement token refresh mechanisms.
  • Offline Support: Detect network status and implement offline-first data strategies.
  • Environment Configuration: Manage API URLs and configurations using environment variables for different environments.

Quick Start

Use the native-data-fetching skill to implement a GET request to 'https://api.example.com/users/123' and display the user data.

Frequently Asked Questions about native-data-fetching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement data fetching and caching in an Expo application?

Data fetching in an Expo application is implemented using the fetch API, React Query, or SWR. These libraries configure efficient data retrieval and local caching strategies, ensuring robust network requests and optimized performance for your mobile application.

What is the best way to manage authentication tokens for API calls in Expo?

Managing authentication tokens for API calls in Expo is best handled using expo-secure-store. This approach securely stores API tokens and implements token refresh mechanisms, ensuring authenticated network requests remain valid without exposing sensitive credentials.

How do I handle network errors and implement retry logic for fetch requests?

Handling network errors and implementing retry logic for fetch requests involves configuring comprehensive error handling for network failures and HTTP errors. This includes setting up specific retry mechanisms to automatically recover from transient connectivity issues.

Can I implement offline support and detect network status in a React Native Expo app?

You can implement offline support and detect network status in a React Native Expo app by configuring offline-first data strategies. This detects the current network status and manages local data handling effectively when connectivity is lost or unreliable.

How do I configure environment variables for API endpoints in Expo?

Configuring environment variables for API endpoints in Expo involves managing API URLs and settings for different environments. This setup separates development and production configurations, ensuring your application requests route to the correct API endpoints securely.