Skip to content

Commit 3221ba0

Browse files
authored
fix: basePath not stored properly (#20)
1 parent 9f5e0d5 commit 3221ba0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/StreamClient.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,20 @@ export class StreamClient {
9292
readonly config?: string | StreamClientOptions,
9393
) {
9494
this.token = JWTServerToken(this.secret);
95-
this.video = new StreamVideoClient(this);
96-
this.chat = new StreamChatClient(this);
9795

9896
if (typeof config === 'string') {
9997
this.options.basePath = config;
10098
this.options.timeout = StreamClient.DEFAULT_TIMEOUT;
10199
} else {
100+
if (config) {
101+
this.options = config;
102+
}
102103
this.options.timeout = config?.timeout ?? StreamClient.DEFAULT_TIMEOUT;
103104
}
104105

106+
this.video = new StreamVideoClient(this);
107+
this.chat = new StreamChatClient(this);
108+
105109
const chatConfiguration = this.getConfiguration();
106110
/** @ts-expect-error */
107111
this.usersApi = new UsersApi(chatConfiguration);

0 commit comments

Comments
 (0)