Skip to main content
The SDK provides debugging tools to help you troubleshoot issues and monitor API interactions during development.

Debug Mode

Enable detailed logging for development and troubleshooting:

Debug Output Examples

Custom Logging

Implement custom logging for production monitoring:

Response Utilities

The SDK provides utilities for working with Response objects:

Performance Monitoring

Request Timing

Monitor request duration in your application:

Memory Usage

Monitor SDK memory usage:

Common Issues & Solutions

Token Management Issues

Problem: Infinite token refresh attemptsSolution: Check token storage and refresh token validity
Problem: Tokens not syncing between browser tabsSolution: Use BrowserTokenStorage which automatically syncs via localStorage

API Request Issues

Problem: Cross-origin request blockedSolution: Verify your domain is allowlisted with Commerce Engine support
Problem: Requests timing outSolution: Configure appropriate timeout and check network conditions

Error Monitoring

Integration with Error Tracking

Error Pattern Analysis

Environment-Specific Debugging

Development Environment

Production Environment

Best Practices

Enable Debug in Development

Always enable debug mode during development to catch issues early

Monitor Error Rates

Track error patterns and response times to identify performance issues

Use Appropriate Timeouts

Set reasonable timeouts based on your application’s needs and network conditions

Implement Custom Logging

Create custom loggers for different environments and monitoring requirements

Cross-References

The debugging features help you understand SDK behavior during development. For production applications, implement appropriate monitoring and error tracking to maintain visibility into API performance.