@stream-io/video-client 0.3.3 → 0.3.4

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/dist/index.es.js CHANGED
@@ -12456,7 +12456,7 @@ class WSConnectionFallback {
12456
12456
  }
12457
12457
  }
12458
12458
 
12459
- const version = '0.3.3';
12459
+ const version = '0.3.4';
12460
12460
 
12461
12461
  const logger = getLogger(['location']);
12462
12462
  const HINT_URL = `https://hint.stream-io-video.com/`;
@@ -12656,6 +12656,14 @@ class StreamClient {
12656
12656
  this.rejectConnectionId = undefined;
12657
12657
  this.resolveConnectionId = undefined;
12658
12658
  });
12659
+ this.connectGuestUser = (user) => __awaiter(this, void 0, void 0, function* () {
12660
+ this.guestUserCreatePromise = this.doAxiosRequest('post', '/guest', {
12661
+ user: Object.assign(Object.assign({}, user), { role: 'guest' }),
12662
+ }, { publicEndpoint: true });
12663
+ const response = yield this.guestUserCreatePromise;
12664
+ this.guestUserCreatePromise.finally(() => (this.guestUserCreatePromise = undefined));
12665
+ return this.connectUser(response.user, response.access_token);
12666
+ });
12659
12667
  /**
12660
12668
  * connectAnonymousUser - Set an anonymous user and open a WebSocket connection
12661
12669
  */
@@ -12735,6 +12743,7 @@ class StreamClient {
12735
12743
  if (!options.publicEndpoint) {
12736
12744
  yield Promise.all([
12737
12745
  this.tokenManager.tokenReady(),
12746
+ this.guestUserCreatePromise,
12738
12747
  this.connectionIdPromise,
12739
12748
  ]);
12740
12749
  }
@@ -13296,10 +13305,7 @@ class StreamVideoClient {
13296
13305
  };
13297
13306
  if (user.type === 'guest') {
13298
13307
  connectUser = () => __awaiter(this, void 0, void 0, function* () {
13299
- const response = yield this.createGuestUser({
13300
- user: Object.assign(Object.assign({}, user), { role: 'guest' }),
13301
- });
13302
- return this.streamClient.connectUser(response.user, response.access_token);
13308
+ return this.streamClient.connectGuestUser(user);
13303
13309
  });
13304
13310
  }
13305
13311
  this.connectionPromise = this.disconnectionPromise