Agent skill · software engineering · aiskillstore

frontend-api-client-with-jwt

A conceptual skill for building an API client in Next.js that handles JWT tokens

Why this skill is useful

Provides specific patterns and implementations for handling JWT authentication in Next.js API clients that the AI wouldn't reliably generate on its own.

What it needs

About 4k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Frontend API Client with JWT Skill When to Use This Skill Use this conceptual skill when you need to implement a robust API client in Next.js that properly handles JWT tokens for authentication. This skill is appropriate for: Creating centralized API communication layer in Next.js applications Managing JWT-based authentication across multiple API endpoints Handling token expiration and refresh scenarios Standardizing error response parsing and handling Implementing secure API communication patterns This skill should NOT be used for: Applications without JWT-based authentication Static sites without API communication needs Applications using alternative authentication methods (API keys, OAuth 2.0 client credentials, etc.) Simple applications with minimal API interaction Prerequisites Next.js application (either App Router or Pages Router) Understanding of JWT (JSON Web Token) concepts Knowledge of HTTP headers and authorization mechanisms Basic understanding of asynchronous JavaScript operations Awareness of client-side vs server-side execution contexts Conceptual Implementation Framework Authorization Header Attachment Capability Automatically attach JWT tokens to API requests as Authorization headers Determine when to include tokens based on request type and endpoint Handle token attachment for both client-side and server-side requests Manage token inclusion in cross-origin requests appropriately Ensure proper header formatting ("Bearer <token>") Token Expiry Handling Capability Detect JWT token expiration before making API requests Implement automatic token refresh mechanisms Handle token refresh failures gracefully Maintain session continuity during token refresh Coordinate token refresh across multiple concurrent requests Store updated tokens securely after refresh Error Response Parsing Capability Parse structured error responses from API endpoints Identify authentication-related errors (401, 403) for special handling Extract meaningful error messages for user …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/frontend-api-client-with-jwt

View the source on GitHub

Browse the @skills marketplace