New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Server and client data fetching patterns for Next.js App Router, covering ISR, revalidation, and loading states.

skills.sh installs
3.9K
GitHub stars
372
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers Server Component fetching, parallel and sequential requests, SWR and React Query setup, and Server Actions
  • Includes ISR with revalidate intervals, tag-based on-demand revalidation via revalidateTag, and cache: 'no-store' opt-outs
  • Enforces 'use client' for hook-based fetching and warns against force-cache on user-specific data
  • Designed for Next.js App Router apps choosing between server and client fetching with error and loading states

Install

$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill nextjs-data-fetching -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Next.js Data Fetching

Overview

Provides patterns for data fetching in Next.js App Router: server-side fetching, SWR/React Query integration, ISR, revalidation, error boundaries, and loading states.

When to Use

  • Implementing data fetching in Next.js App Router
  • Choosing between Server Components and Client Components
  • Setting up SWR or React Query for client-side caching
  • Configuring ISR, time-based, or on-demand revalidation
  • Handling loading and error states
  • Building forms with Server Actions

Instructions

Server Component Fetching

Fetch directly in async Server Components:

async function getPosts() {
  const res = await fetch('https://api.example.com/posts');
  if (!res.ok) throw new Error('Failed to fetch posts');
  return res.json();
}

export default async function PostsPage() {
  const posts = await getPosts();
  return (
    <ul>
      {posts.map((post) => (
        <li key={post.id}>{post.title}</li>
      ))}
    </ul>
  );
}

Parallel Data Fetching

Use Promise.all() for independent requests:

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Category
Frontend & UI Code
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 95

Similar to Nextjs Data Fetching

More Frontend & UI Code