tanstack-client-api-layer

Create a type-safe API client layer for TanStack Start and Router projects.

5|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/agusmdev/fullstack-ai-template --skill tanstack-client-api-layer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-client-api-layer
Source: https://github.com/agusmdev/fullstack-ai-template/tree/main/.claude/skills/tanstack-client-api-layer
Command: npx skills add https://github.com/agusmdev/fullstack-ai-template --skill tanstack-client-api-layer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This API client layer provides a type-safe fetch wrapper, centralized error handling, authentication headers, and React Query integration for TanStack Start and TanStack Router projects.

Core Features & Use Cases

  • Type-safe API client with centralized error handling and auth headers
  • React Query integration for data fetching and mutations in TanStack Start/Router apps
  • Configurable base URL and token management for seamless authentication in client apps

Quick Start

Use this skill to initialize a ready-to-use API client layer workflow in a TanStack project, producing a typed apiClient with automatic auth header handling and error types.

Frequently Asked Questions about tanstack-client-api-layer

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

FAQPage Schema
How do I set up a type-safe API client layer in a TanStack Start project?

A type-safe API client layer for TanStack Start provides a centralized fetch wrapper with standardized error handling, automatic auth headers, and React Query integration to manage data fetching and mutations across your application.

What is the best way to handle API authentication headers with React Query?

The best way to handle API authentication headers with React Query is through a centralized API client wrapper that automatically injects auth tokens into requests, ensuring consistent authentication across all data fetching and mutation operations.

How does centralized error handling work in a TypeScript API client?

Centralized error handling in a TypeScript API client works by defining custom error classes and response types within a fetch wrapper, allowing you to uniformly catch, process, and standardize API communication errors across your entire application.

Can I use this API client layer for both SSR-full-stack and SPA client models?

Yes, this API client layer supports both SSR-full-stack and SPA client models in TanStack Start and TanStack Router projects, allowing you to standardize API communications and configure base URLs seamlessly across different rendering environments.

Why do I need interceptors in a TanStack Router API client?

You need interceptors in a TanStack Router API client to manage configurable base URLs, manipulate authentication tokens, and standardize request and response handling before data reaches your React Query hooks.