debugToken
Decode token components for inspection without validating the signature. Useful for debugging token contents and checking expiration.
debugToken returns diagnostic data only when
debugMode
is true. With debugMode: false (the default), it returns
{ valid_format: false, error: "debug mode not enabled" } — matching the
Python SDK’s behavior. Enable debugMode at runtime only when you need to
inspect tokens.
Parameters
token
The base64url-encoded token to decode.
Returns
DebugTokenResult — a nested object with the following optional fields:
valid_format
true when the token decoded into five dot-separated parts; false otherwise.
components
Present only when valid_format is true.
Call ID extracted from the token. Truncated to 8 characters followed by ...
when longer than 8 characters.
Function name encoded in the token.
Token expiry as a Unix timestamp string.
ISO 8601 string representation of the expiry, or null when the expiry
component did not parse as a number.
The random nonce component of the token.
Token signature. Truncated to 8 characters followed by ... when longer than
8 characters.
status
Present only when valid_format is true.
Current Unix timestamp in seconds.
true if expired, false if still valid, null if the expiry component
did not parse.
Seconds remaining until expiry, or 0 when expired, or null when expiry
did not parse.
parts_count
Only populated when valid_format is false because the decoded token had
an unexpected number of dot-separated parts.
token_length
Length of the raw token string. Populated when valid_format is false.
error
Set to "debug mode not enabled" when debugMode is false, or to the
caught error message when decoding failed.