# Client (/sdks/nodejs/reference/client)



The Node.js SDK centers on `KubeMQClient`, created through an async factory. Connections are Promise-based and pair with TypeScript definitions for every public method.

## Package [#package]

```bash
npm install kubemq-js
```

Requires Node.js 20+. Ships compiled JavaScript with `.d.ts` declarations.

## Factory [#factory]

### create [#create]

```typescript
const client = await KubeMQClient.create(options: ClientOptions): Promise<KubeMQClient>
```

**Parameters:**

| Name      | Type            | Required | Description                                   |
| --------- | --------------- | -------- | --------------------------------------------- |
| `options` | `ClientOptions` | Yes      | Address, TLS, auth token, timeouts, client ID |

**Returns:** `Promise<KubeMQClient>` — connected client.

**Throws:** `KubeMQError` — connection, TLS, or validation failures.

## Close [#close]

```typescript
await client.close(): Promise<void>
```

Gracefully shuts down streams and the gRPC channel.

## Quick Usage [#quick-usage]

```typescript title="client.ts"
import { KubeMQClient } from "kubemq-js";

const client = await KubeMQClient.create({
  address: "localhost:50000",
  clientId: "node-demo",
});

await client.close();
```

## See Also [#see-also]

* [Connection Examples](/sdks/nodejs/how-to/connection/)
* Concepts
* [Node.js SDK Getting Started](/sdks/nodejs)
