# Expo data fetching

> Expo data fetching is an open-source agent skill for developer tools. Guides an AI agent through fetch, React Query, auth tokens and offline handling in Expo. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ScaleDockHQ/better-supabase/tree/main/.agents/skills/expo-data-fetching
- **Repository:** https://github.com/scaledockhq/better-supabase
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** expo-data-fetching
- **Collection:** https://github.com/ScaleDockHQ/better-supabase
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill gives an agent a playbook for networking inside Expo and React Native apps. It covers plain fetch calls with status checks, TanStack Query setup and mutations, retry with backoff, and token storage in expo-secure-store with a refresh pattern. It also sets out how screens should handle loading, error, empty and cached-content states so a failed refresh does not wipe what the user already sees.

The instructions include code samples for each area, along with decision guidance such as choosing React Query over SWR for larger apps and preferring expo/fetch over axios. Environment configuration with EXPO_PUBLIC_ variables and separate development and production env files is documented, including a warning against putting secrets in client-visible variables. Offline detection with NetInfo, request cancellation and Expo Router route loaders are split into a separate reference file.

The skill is written for React Native and Expo projects in TypeScript. It names expo-secure-store, React Query and NetInfo, so those packages need to be part of the app for the examples to apply. It includes no scripts; it only provides guidance and code to adapt.

## When your agent uses it

> Implement or debug data fetching in Expo apps. Use for fetch API calls, React Query, SWR, authenticated requests, caching, retries, offline support, loading and error states, or Expo Router data loaders (useLoaderData).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ScaleDockHQ/better-supabase/tree/HEAD/.agents/skills/expo-data-fetching)
- [License: MIT](https://github.com/ScaleDockHQ/better-supabase/tree/HEAD/.agents/skills/expo-data-fetching)

## Features

- **Basic fetch patterns:** Shows GET and POST requests with response status checks and typed error handling.
- **React Query setup:** Covers the query client, useQuery fetching and mutations with invalidation.
- **Screen state handling:** Explains loading, error, empty and cached-content states for data screens.
- **Secure token management:** Stores auth tokens with expo-secure-store and adds a guarded token refresh flow.
- **Retry and error helpers:** Provides a retry wrapper with exponential backoff and a network error type.
- **Environment-based API config:** Explains EXPO_PUBLIC_ variables, per-environment env files and secret handling.
- **Offline and cancellation guide:** Points to a reference on NetInfo status, offline-first queries and AbortController.

## Good for

- Add a data-fetching layer with React Query to an Expo app
- Wire a bearer token into API requests stored with SecureStore
- Handle a failed refresh while keeping cached screen data visible
- Configure separate dev and production API URLs in Expo
- Add retry with backoff to flaky network requests
- Debug a fetch call that fails in a React Native screen

## Install

### Claude Code

This skill ships in the `better-supabase` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ScaleDockHQ/better-supabase
/plugin install better-supabase@better-supabase
```

Or copy only this skill to `~/.claude/skills/expo-data-fetching`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/expo-data-fetching &&
cp -R "$tmp/.agents/skills/expo-data-fetching" ~/.claude/skills/expo-data-fetching &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/expo-data-fetching` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/expo-data-fetching` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/expo-data-fetching &&
cp -R "$tmp/.agents/skills/expo-data-fetching" ~/.agents/skills/expo-data-fetching &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/expo-data-fetching` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/expo-data-fetching` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/expo-data-fetching &&
cp -R "$tmp/.agents/skills/expo-data-fetching" ~/.cursor/skills/expo-data-fetching &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/expo-data-fetching` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ScaleDockHQ/better-supabase.git --path .agents/skills/expo-data-fetching
```

Or copy the folder to `~/.gemini/skills/expo-data-fetching` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/expo-data-fetching`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/expo-data-fetching &&
cp -R "$tmp/.agents/skills/expo-data-fetching" ~/.copilot/skills/expo-data-fetching &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/expo-data-fetching` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git
```

Then copy `better-supabase/.agents/skills/expo-data-fetching` into your agent's skills folder as `expo-data-fetching`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which libraries does Expo data fetching assume are installed?

The examples use TanStack Query, expo-secure-store and NetInfo, with fetch as the base HTTP client. The skill recommends expo/fetch over axios.

### Does Expo data fetching store tokens securely?

It recommends expo-secure-store for tokens and calls out AsyncStorage as insecure for that purpose.

### Can Expo data fetching expose API keys to the app bundle?

The skill warns that EXPO_PUBLIC_ variables are visible in the built app, so secret keys should stay out of them and be used only in API routes.

### Does Expo data fetching cover Expo Router data loaders?

It mentions useLoaderData for web with SDK 55 and later, and points to a separate reference file for route-level loaders.

### How do I install Expo data fetching in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/expo-data-fetching to use it in all your projects, or to .claude/skills/expo-data-fetching in one project. Or install the better-supabase plugin, which includes it: /plugin marketplace add ScaleDockHQ/better-supabase, then /plugin install better-supabase@better-supabase.

### Does Expo data fetching run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Expo data fetching?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Expo data fetching?

The closest alternatives to Expo data fetching are Expo data fetching, Expo native UI, Expo router, Expo native UI and Expo router.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Expo data fetching](https://ai-powered.com/skills/expo-data-fetching): Expo data fetching is an open-source agent skill for developer tools.
- [Expo native UI](https://ai-powered.com/skills/expo-native-ui-scaledockhq): Expo native UI is an open-source agent skill for developer tools.
- [Expo router](https://ai-powered.com/skills/expo-router-scaledockhq): Expo router is an open-source agent skill for developer tools.
- [Expo native UI](https://ai-powered.com/skills/expo-native-ui): Expo native UI is an open-source agent skill for developer tools.
- [Expo router](https://ai-powered.com/skills/expo-router): Expo router is an open-source agent skill for developer tools.
- [Expo overview](https://ai-powered.com/skills/expo-overview-scaledockhq): Expo overview is an open-source agent skill for developer tools.
- [Expo examples](https://ai-powered.com/skills/expo-examples-scaledockhq): Expo examples is an open-source agent skill for developer tools.
- [Expo upgrade](https://ai-powered.com/skills/expo-upgrade-scaledockhq): Expo upgrade is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/expo-data-fetching-scaledockhq
