IO Wallet SDK
    Preparing search index...
    • Decodes a compact JWT and validates its header and payload with Zod schemas.

      This helper does not verify the JWT signature.

      Type Parameters

      • HeaderSchema extends BaseSchema | undefined = undefined
      • PayloadSchema extends BaseSchema | undefined = undefined

      Parameters

      • options: DecodeJwtOptions<HeaderSchema, PayloadSchema>

        Decode options.

        • OptionalerrorMessagePrefix?: string

          Optional prefix for error messages thrown during decoding, to provide more context on where the error occurred

        • OptionalheaderSchema?: HeaderSchema

          Schema to use for validating the header. If not provided the default zJwtHeader schema will be used

        • jwt: string

          The compact encoded jwt

        • OptionalpayloadSchema?: PayloadSchema

          Schema to use for validating the payload. If not provided the default zJwtPayload schema will be used

      Returns DecodeJwtResult<HeaderSchema, PayloadSchema>

      Decoded and schema-validated JWT header, payload, and signature segment.

      If the JWT shape or base64url JSON segments are invalid.

      If header or payload schema validation fails.