@nuskin/ns-product-lib 2.3.0 → 2.3.1-cx12-5910.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.3.1-cx12-5910.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.3.0...v2.3.1-cx12-5910.1) (2022-10-25)
2
+
3
+
4
+ ### Fix
5
+
6
+ * window object doesn't exist in lambda ([e092ad6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/e092ad6ac2fda7d550c5df6c360eb52e044834a2))
7
+
1
8
  # [2.3.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.2.0...v2.3.0) (2022-10-14)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.3.0",
3
+ "version": "2.3.1-cx12-5910.1",
4
4
  "description": "This project contains shared Product models and code between the backend and frontend.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -4,11 +4,11 @@ const { getEnvironmentFromUrl } = require('@nuskin/ns-common-lib');
4
4
  const config = require('./environment');
5
5
 
6
6
  // contentstack HTTP service
7
- const env = getEnvironmentFromUrl(window.location.host);
8
- const envConfig = config.getCredentials(env);
9
- const baseURL = `${envConfig.url}/stacks/${envConfig.apiKey}?environment=${envConfig.env}`;
7
+ const env = getEnvironmentFromUrl(window ? window.location.host : null);
8
+ const envConfig = env ? config.getCredentials(env) : null;
9
+ const baseURL = env ? `${envConfig.url}/stacks/${envConfig.apiKey}?environment=${envConfig.env}` : null;
10
10
  const headers = {
11
- 'access_token': `${envConfig.accessToken}`,
11
+ 'access_token': env ? `${envConfig.accessToken}` : '',
12
12
  'Content-Type': 'application/json'
13
13
  };
14
14
  const http = axios.create({ baseURL, headers });