Node.js SDK API Reference
OAuth Exchange
exchangeCodeForClaims(options)
Exchanges a Hawcx authorization code for verified JWT claims.
Parameters:
OAuthExchangeError- Failed to exchange code for tokenJWTVerificationError- JWT signature or claims validation failedInvalidPublicKeyError- Public key is malformed
JWT Verification
verifyJwt(token, publicKey, options?)
Manually verify a JWT token using the provided public key.
Parameters:
Delegation Client
TheHawcxDelegationClient provides high-level APIs for managing user MFA settings and credentials.
HawcxDelegationClient.fromKeys(options)
Initialize the delegation client with explicit cryptographic keys.
Parameters:
initiateMfaChange(options)
Initiate MFA setup or change for a user.
Parameters:
verifyMfaChange(options)
Verify OTP and complete MFA setup or change.
Parameters:
getUserCredentials(userid)
Retrieve the current MFA method and credentials for a user.
Parameters:
userid(string) - User email or ID
