@unboundcx/sdk 2.7.2 → 2.7.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.
Files changed (2) hide show
  1. package/base.js +13 -11
  2. package/package.json +1 -1
package/base.js CHANGED
@@ -180,6 +180,19 @@ export class BaseSDK {
180
180
  },
181
181
  );
182
182
 
183
+ // Add auth headers
184
+ if (this.token) {
185
+ headers.Authorization = `Bearer ${this.token}`;
186
+ }
187
+ if (this.fwRequestId) {
188
+ headers['x-request-id-fw'] = this.fwRequestId;
189
+ }
190
+ if (this.callId) {
191
+ headers['x-call-id'] = this.callId;
192
+ }
193
+
194
+ params.headers = headers;
195
+
183
196
  // Try transport plugins first
184
197
  const transport = await this._getAvailableTransport(forceFetch);
185
198
  let response;
@@ -260,17 +273,6 @@ export class BaseSDK {
260
273
  },
261
274
  };
262
275
 
263
- // Add auth headers
264
- if (this.token) {
265
- options.headers.Authorization = `Bearer ${this.token}`;
266
- }
267
- if (this.fwRequestId) {
268
- options.headers['x-request-id-fw'] = this.fwRequestId;
269
- }
270
- if (this.callId) {
271
- options.headers['x-call-id'] = this.callId;
272
- }
273
-
274
276
  // Set credentials for browser environment
275
277
  if (this.environment === 'browser') {
276
278
  options.credentials = 'include';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "2.7.2",
3
+ "version": "2.7.3",
4
4
  "description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
5
5
  "main": "index.js",
6
6
  "type": "module",