# JWT

> JWT implementation, token management, refresh patterns, and security.

- Skill: `a5c-ai/jwt` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add a5c-ai/jwt`
- Raw SKILL.md: https://api.skillmd.com/api/skills/a5c-ai/jwt/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: a5c-ai (https://skillmd.com/u/a5c-ai)
- Updated: 2026-08-19
- Page: https://skillmd.com/skills/a5c-ai/jwt

---


# JWT Skill

Expert assistance for JWT authentication implementation.

## Capabilities

- Generate and verify tokens
- Implement refresh tokens
- Handle token storage
- Configure expiration
- Secure token handling

## Implementation

```typescript
import jwt from 'jsonwebtoken';

function generateTokens(user: User) {
  const accessToken = jwt.sign(
    { id: user.id, role: user.role },
    process.env.JWT_SECRET!,
    { expiresIn: '15m' }
  );

  const refreshToken = jwt.sign(
    { id: user.id },
    process.env.REFRESH_SECRET!,
    { expiresIn: '7d' }
  );

  return { accessToken, refreshToken };
}

function verifyToken(token: string) {
  return jwt.verify(token, process.env.JWT_SECRET!);
}
```

## Target Processes

- jwt-authentication
- auth-implementation
- api-security

