What problem does it solve?
Next.js frontend often needs to securely call a FastAPI backend while preserving authentication cookies across server boundaries. This skill provides a proven pattern to proxy /api/* routes, forward cookies, and propagate Set-Cookie headers correctly to maintain session integrity.
Core Features & Use Cases
- API Route Proxies: Implement Next.js API routes that forward requests to FastAPI with proper cookie handling.
- Cookie Forwarding & Set-Cookie Propagation: Ensure authentication tokens flow between client, Next.js server, and FastAPI backend.
- Server Actions & SSR: Support server-side data fetching for Server Components via server actions.
- Typed Client & Server APIs: Provide typed API clients for client and server code and consistent error handling.
- SWR Integration: Use SWR with typed results and stable data fetching patterns.
Quick Start
Use the api-integration skill to create a new Next.js API proxy route that forwards cookies to the FastAPI backend and implements a server action for fetching user data.