useIssueJwt
hook provides functionality to request Para JWT tokens that contain attestations for the user’s ID, identity, and provisioned wallets.
Hook for issuing JWT tokens for session verification
useIssueJwt
hook provides functionality to request Para JWT tokens that contain attestations for the user’s ID, identity, and provisioned wallets.
import { useIssueJwt } from "@getpara/react-sdk@alpha";
function JwtTokenManager() {
const { issueJwt, issueJwtAsync, isPending, error } = useIssueJwt();
const [tokenInfo, setTokenInfo] = useState<{ token: string; keyId: string } | null>(null);
const handleIssueToken = async () => {
try {
const result = await issueJwtAsync();
setTokenInfo({
token: result.token,
keyId: result.keyId
});
await sendTokenToBackend(result.token);
} catch (err) {
console.error("Failed to issue JWT:", err);
}
};
return (
<button
onClick={handleIssueToken}
disabled={isPending}
>
{isPending ? "Issuing..." : "Issue JWT Token"}
</button>
);
}