appflare-client

Connect web and mobile frontends to an Appflare backend using the generated client and React hooks.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Imtiajrex/appflare-skills --skill appflare-client-imtiajrex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: appflare-client
Source: https://github.com/Imtiajrex/appflare-skills/tree/main/skills/appflare-client
Command: npx skills add https://github.com/Imtiajrex/appflare-skills --skill appflare-client-imtiajrex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tanstack/react-query, better-auth, and includes references (resource) components.

What problem does it solve? Wiring a frontend to an Appflare backend requires knowing how to instantiate the generated client, manage bearer tokens, call typed query and mutation routes, and handle realtime updates. This Skill provides the exact patterns, code snippets, and gotchas so an AI agent can implement client-side data fetching, authentication, and storage correctly on the first attempt. ## Core Features & Use Cases - Generated Client Setup: Create a single shared Appflare client with endpoint, wsEndpoint, and bearer-token storage callbacks for web or React Native. - Typed Data Fetching: Call appflare.queries.* and appflare.mutations.* with .run() returning { data, error }, or use useQuery, useMutation, and useInfiniteQuery hooks built on TanStack Query. - Auth & Realtime: Implement Better Auth sign-up/sign-in flows with bearer tokens, role-aware UI, and realtime subscriptions that push changes into the query cache. - Use Case: A developer building a React task app uses this Skill to set up the shared client, wrap the app in QueryClientProvider, fetch tasks with realtime updates, and add email/password login. ## Quick Start Use the appflare-client skill to create a shared Appflare client module and fetch data from my backend with React hooks.

Frequently Asked Questions about appflare-client

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

FAQPage Schema
How do I call an Appflare backend from a React frontend?▼

Create one shared client with new Appflare({ endpoint, onGetAuthToken, onSetAuthToken }), wrap your app in QueryClientProvider, then call routes via appflare.queries.* and appflare.mutations.*. Use the useQuery and useMutation hooks from appflare/react for component-level data fetching.

How do I implement sign-in with the Appflare client?▼

Call appflare.auth.signIn.email({ email, password }) after enabling emailAndPassword and the bearer() plugin on the server. The token arrives via the set-auth-token header and is stored through your onSetAuthToken callback, then sent as a Bearer header on later requests.

Does the Appflare client work with React Native?▼

Yes, the same client works in React Native. Store the token with AsyncStorage or SecureStore instead of localStorage, and on the Android emulator use http://10.0.2.2:8787 instead of localhost as the endpoint.

Why does my Appflare realtime subscription not receive updates?▼

Realtime requires the wsEndpoint option when creating the client. Note that subscribe() only pushes changes after the initial load, and useInfiniteQuery realtime pushes replace only the first page of results.

Why does appflare.storage.download() fail to return the file?▼

download() parses the response as JSON while the route streams raw bytes, so it fails. Use storage.preview({ path }) to get a plain URL instead, fetching it with the bearer header for private files.