From de98e0e294c57324eedd48c393045fc0b854808e Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Thu, 7 Mar 2024 14:16:19 +0100 Subject: [PATCH] fix: basePath not stored properly --- src/StreamClient.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/StreamClient.ts b/src/StreamClient.ts index fa60ac3..6d4f090 100644 --- a/src/StreamClient.ts +++ b/src/StreamClient.ts @@ -92,16 +92,20 @@ export class StreamClient { readonly config?: string | StreamClientOptions, ) { this.token = JWTServerToken(this.secret); - this.video = new StreamVideoClient(this); - this.chat = new StreamChatClient(this); if (typeof config === 'string') { this.options.basePath = config; this.options.timeout = StreamClient.DEFAULT_TIMEOUT; } else { + if (config) { + this.options = config; + } this.options.timeout = config?.timeout ?? StreamClient.DEFAULT_TIMEOUT; } + this.video = new StreamVideoClient(this); + this.chat = new StreamChatClient(this); + const chatConfiguration = this.getConfiguration(); /** @ts-expect-error */ this.usersApi = new UsersApi(chatConfiguration);