diff --git a/src/ThreadsConfig.ts b/src/ThreadsConfig.ts index 0143aaf1d..7570561ae 100644 --- a/src/ThreadsConfig.ts +++ b/src/ThreadsConfig.ts @@ -21,7 +21,11 @@ export class ThreadsConfig extends Config { super() this.host = `${this.apiScheme}://${this.api}:${this.threadsPort}` } - async start() { + async start(sessionId?: string) { + if (sessionId !== undefined) { + this.session = sessionId + return + } await this.refreshSession() } get sessionAPI(): string { diff --git a/src/index.ts b/src/index.ts index 6d41118c6..72333aed5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,8 +50,8 @@ export class API { ) } - async start() { - await this._threadsConfig.start() + async start(sessionId?: string) { + await this._threadsConfig.start(sessionId) return this }