Skip to main content
The SDK throws typed errors that you can catch and handle.

Error classes

The Node.js SDK exports:
  • MailGlyphError
  • AuthenticationError
  • ValidationError
  • NotFoundError
  • RateLimitError
  • ApiError

Catch typed errors

Key-type mismatch example

events.track requires a public key and most other methods require a secret key.

Retry and timeout behavior

The SDK automatically retries transient failures:
  • Up to 3 retries for 429 and 5xx responses
  • Uses exponential backoff when retry-after is not present
  • Throws timeout errors when request duration exceeds the configured timeout
You can customize timeout in client config: