@theredhead — Frontend Library - v1.0.0
    Preparing search index...
    • Extract a specific claim value from a JWT payload.

      This is a convenience wrapper around decodeJwt for quick one-off claim reads.

      Type Parameters

      • T = unknown

      Parameters

      • token: string

        A JWT in compact serialisation.

      • claim: string

        The claim name to extract.

      Returns T | undefined

      The claim value, or undefined if absent.

      const sub = extractClaim(rawToken, 'sub');   // "user-123"
      const role = extractClaim(rawToken, 'role'); // "editor"