# @eiva/fletcher-gateway-client

> TypeScript client for the Fletcher gateway — WebSocket transport with positional row codec

Latest version **0.1.3-alpha** (published 2026-05-29) · LGPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @eiva/fletcher-gateway-client
pnpm add @eiva/fletcher-gateway-client
yarn add @eiva/fletcher-gateway-client
bun add @eiva/fletcher-gateway-client
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.3-alpha |
| Published | 2026-05-29 |
| First published | 2026-05-29 |
| Weekly downloads | 0 |
| License | LGPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 97.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | acmeiva, eivaadmin |

## Links

- npm: https://www.npmjs.com/package/@eiva/fletcher-gateway-client
- Repository: https://github.com/eivacom/Fletcher
- Homepage: https://github.com/eivacom/Fletcher/tree/main/gateway-client-ts#readme
- Issues: https://github.com/eivacom/Fletcher/issues
- npm.io page: https://npm.io/package/@eiva/fletcher-gateway-client

## Recent versions

- 0.1.3-alpha (latest) — 2026-05-29
- 0.4.0-alpha (alpha) — 2026-06-23
- 0.3.0-alpha — 2026-06-09
- 0.1.4-alpha — 2026-05-29

## README

# @eiva/fletcher-gateway-client

[![npm (scoped)](https://img.shields.io/npm/v/@eiva/fletcher-gateway-client?label=latest)](https://www.npmjs.com/package/@eiva/fletcher-gateway-client)
[![npm (scoped with tag)](https://img.shields.io/npm/v/@eiva/fletcher-gateway-client/alpha?label=alpha)](https://www.npmjs.com/package/@eiva/fletcher-gateway-client)

TypeScript client for the Fletcher WebGateway — WebSocket transport with positional row codec.

## Installation

```bash
# latest stable
npm install @eiva/fletcher-gateway-client

# latest alpha
npm install @eiva/fletcher-gateway-client@alpha
```

## Usage

```ts
import { FletcherClient } from '@eiva/fletcher-gateway-client';
import type { SchemaDescriptor } from '@eiva/fletcher-gateway-client';

const client = new FletcherClient({ url: 'ws://localhost:9090' });
await client.connect();

const schema: SchemaDescriptor = {
  fields: [
    { name: 'x', type: 'float64' },
    { name: 'y', type: 'float64' },
  ],
};

// Publish
await client.createTopic('position', schema);
await client.publish('position', schema, { x: 1.0, y: 2.0 });

// Subscribe
await client.subscribe('position', schema, (row, attachments) => {
  console.log(row.x, row.y);
});

// List topics
const topics = await client.listTopics();

client.close();
```

## API

### `FletcherClient`

| Method | Description |
|---|---|
| `connect()` | Open the WebSocket connection |
| `createTopic(topic, schema?)` | Create a topic, optionally announcing its schema |
| `subscribe(topic, schema, callback)` | Subscribe to a topic |
| `unsubscribe(subId)` | Unsubscribe by subscription ID |
| `publish(topic, schema, data, attachments?)` | Publish a row to a topic |
| `listTopics()` | List all topics on the gateway |
| `close()` | Close the connection |

### `FletcherClientOptions`

| Option | Type | Default | Description |
|---|---|---|---|
| `url` | `string` | — | WebSocket URL, e.g. `ws://localhost:9090` |
| `backend` | `'object' \| 'arrow'` | `'object'` | Decode backend |
| `reconnectDelay` | `number` | `0` | Reconnect delay in ms (0 to disable) |

## License

LGPL-3.0-or-later © The Fletcher Authors

---
_Source: https://npm.io/package/@eiva/fletcher-gateway-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
