Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
# CHANGELOG

## v5.1.0

### API Versions

| API Name | API Version |
|----------|-------------|
| shopper-login | 1.46.0 |
| shopper-baskets | 1.11.0 |
| shopper-baskets | 2.5.1 |
| shopper-configurations | 1.2.0 |
| shopper-consents | 1.1.4 |
| shopper-context | 1.1.3 |
| shopper-customers | 1.6.1 |
| shopper-experience | 1.2.1 |
| shopper-gift-certificates | 1.2.0 |
| shopper-orders | 1.12.1 |
| shopper-payments | 1.4.0 |
| shopper-products | 1.3.0 |
| shopper-promotions | 1.2.0 |
| shopper-search | 1.8.0 |
| shopper-seo | 1.0.17 |
| shopper-stores | 1.2.0 |

### Enchancements

- Allow developers to pass in custom fetch implementation via `clientConfig` [#272](https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic/pull/272)

## v5.0.0

### API Versions

| API Name | API Version |
|----------|-------------|
| shopper-baskets | 1.9.4 |
| shopper-baskets | 2.3.3 |
| shopper-configurations | 1.0.2 |
| shopper-consents | 1.1.4 |
| shopper-context | 1.1.3 |
| shopper-customers | 1.3.2 |
| shopper-experience | 1.1.2 |
| shopper-gift-certificates | 1.0.29 |
| shopper-login | 1.42.2 |
| shopper-orders | 1.10.0 |
| shopper-payments | 1.2.3 |
| shopper-products | 1.1.3 |
| shopper-promotions | 1.0.39 |
| shopper-search | 1.5.4 |
| shopper-seo | 1.0.17 |
| shopper-stores | 1.0.19 |

## v4.2.0

### API Versions
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,45 @@ await helpers.callCustomEndpoint({

For more documentation about this helper function, please refer to the [commerce-sdk-isomorphic docs](https://salesforcecommercecloud.github.io/commerce-sdk-isomorphic/modules/helpers.html).

#### Custom Fetch function

You can provide your own custom fetch function to intercept, log, or modify all SDK requests. This is useful for:
- **Request/Response Logging**: Track all API calls for debugging and monitoring
- **Request Interception**: Add custom headers, modify request URLs, or implement custom retry logic
- **Error Handling**: Add custom error processing or transformation before responses reach your application
- **Performance Monitoring**: Measure request/response times and track API performance metrics

**Example with Logging:**
```javascript
// Custom fetch function with detailed logging
const customFetch = async (url, options) => {
console.log(`[SDK Request] ${options?.method || 'GET'} ${url}`);
console.log('[SDK Request Headers]', options?.headers);
if (options?.body) {
console.log('[SDK Request Body]', options.body);
}

const startTime = Date.now();
const response = await fetch(url, options);
const duration = Date.now() - startTime;

console.log(`[SDK Response] ${response.status} ${response.statusText} (${duration}ms)`);
console.log('[SDK Response Headers]', Object.fromEntries(response.headers.entries()));

return response;
};

const config = {
parameters: {
clientId: '<your-client-id>',
organizationId: '<your-org-id>',
shortCode: '<your-short-code>',
siteId: '<your-site-id>',
},
fetch: customFetch,
};
```

#### Encoding special characters

The SDK currently single encodes special characters for query parameters in UTF-8 format based on SCAPI guidelines. However, the SDK does NOT encode path parameters, and will require the developer to encode any path parameters with special characters.
Expand Down
28 changes: 16 additions & 12 deletions api-versions.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
shopper-baskets-oas-v1=1.9.1
shopper-baskets-oas-v2=2.1.1
# APIs for ECOM v26.3
# Formally Shopper Login
auth-oas-v1=1.46.0
shopper-baskets-oas-v1=1.11.0
shopper-baskets-oas-v2=2.5.1
shopper-configurations-oas-v1=1.2.0
shopper-consents-oas-v1=1.1.4
shopper-context-oas-v1=1.1.3
shopper-customers-oas-v1=1.2.1
shopper-experience-oas-v1=1.1.2
shopper-gift-certificates-oas-v1=1.0.29
shopper-login-oas-v1=1.42.2
shopper-orders-oas-v1=1.6.0
shopper-products-oas-v1=1.1.2
shopper-promotions-oas-v1=1.0.39
shopper-search-oas-v1=1.5.4
shopper-seo-oas-v1=1.0.16
shopper-stores-oas-v1=1.0.19
shopper-customers-oas-v1=1.6.1
shopper-experience-oas-v1=1.2.1
shopper-gift-certificates-oas-v1=1.2.0
shopper-orders-oas-v1=1.12.1
shopper-payments-oas-v1=1.4.0
shopper-products-oas-v1=1.3.0
shopper-promotions-oas-v1=1.2.0
shopper-search-oas-v1=1.8.0
shopper-seo-oas-v1=1.0.17
shopper-stores-oas-v1=1.2.0
Loading
Loading