@saasquatch/squatch-js 2.4.2-2 → 2.4.2-3

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
@@ -11,16 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ### Added
13
13
 
14
- - Added option to return encoded _saasquatch cookie as a string from `squatchReferralCookie`
14
+ - Added value to return data `squatchReferralCookie` to retrieve the encoded cookie
15
15
 
16
16
  - Example:
17
17
 
18
18
  ```js
19
19
  squatch
20
20
  .api()
21
- .squatchReferralCookie(true)
21
+ .squatchReferralCookie()
22
22
  .then(function (response) {
23
- element.value = response.codes["program-id"];
23
+ const cookie = response.encodedCookie;
24
24
  });
25
25
  ```
26
26
 
@@ -350,7 +350,7 @@ class WidgetApi {
350
350
  const cookie = _saasquatch ? `?cookies=${encodeURIComponent(_saasquatch)}` : ``;
351
351
  const url = `${this.domain}/a/${tenantAlias}/widgets/squatchcookiejson${cookie}`;
352
352
  const response = doGet(url);
353
- return Promise.resolve(_extends({}, response, {
353
+ return Promise.resolve(_extends({}, Promise.resolve(response), {
354
354
  encodedCookie: _saasquatch
355
355
  }));
356
356
  }
package/dist/squatch.js CHANGED
@@ -377,7 +377,7 @@ class WidgetApi {
377
377
  const cookie = _saasquatch ? `?cookies=${encodeURIComponent(_saasquatch)}` : ``;
378
378
  const url = `${this.domain}/a/${tenantAlias}/widgets/squatchcookiejson${cookie}`;
379
379
  const response = doGet(url);
380
- return Promise.resolve(_extends({}, response, {
380
+ return Promise.resolve(_extends({}, Promise.resolve(response), {
381
381
  encodedCookie: _saasquatch
382
382
  }));
383
383
  }