close

View as MarkdownOpen in Claude

Complete the client’s lifecycle. The client holds no pooled connection of its own, so there is nothing to tear down and calling it more than once is safe. It exists so code can treat AIChatClient like any other disposable resource.

The client also implements Symbol.asyncDispose, so await using client = new AIChatClient(...) calls close() for you when the scope exits.

Parameters

None.

Returns

Promise<void>

Example

Outside an await using block, close it yourself:

import { AIChatClient } from '@signalwire/sdk';
const client = new AIChatClient({ space: 'your-space' });
try {
const reply = await client.chat('chat-8f21', 'Where is my van?');
console.log('Ada:', reply.text);
} finally {
await client.close();
}