# yaschema-ws-api

> Web socket API support for yaschema

Latest version **4.0.3** (published 2025-09-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install yaschema-ws-api
pnpm add yaschema-ws-api
yarn add yaschema-ws-api
bun add yaschema-ws-api
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2025-09-15 |
| First published | 2023-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 35.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | bwestphal |
| Keywords | schema, typescript, client, server, websocket |

## Links

- npm: https://www.npmjs.com/package/yaschema-ws-api
- Repository: https://github.com/TypeScript-OSS/yaschema-ws-api
- Homepage: https://typescript-oss.github.io/yaschema-ws-api/
- Issues: https://github.com/TypeScript-OSS/yaschema-ws-api/issues
- npm.io page: https://npm.io/package/yaschema-ws-api

## Dependencies (2)

- [yaschema](https://npm.io/package/yaschema.md) ^5.2.2
- [yaschema-api](https://npm.io/package/yaschema-api.md) ^5.0.5

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 4.0.3 (latest) — 2025-09-15
- 4.0.2 — 2025-05-13
- 4.0.1 — 2025-05-09
- 4.0.0 — 2025-04-30
- 3.1.10 — 2025-04-19
- 3.1.9 — 2025-04-11
- 3.1.8 — 2025-04-05
- 3.1.7 — 2025-03-02
- 3.1.6 — 2025-02-18
- 3.1.5 — 2025-01-16
- 3.1.4 — 2025-01-06
- 3.1.3 — 2024-12-06
- 3.1.2 — 2024-12-06
- 3.1.1 — 2024-11-26
- 3.1.0 — 2024-11-15
- … 32 more at https://npm.io/package/yaschema-ws-api/versions

## README

# yaschema-ws-api

[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Web socket API support for yaschema.

## Basic Example

```typescript
export const stream = makeWsApi({
  routeType: 'stream',
  url: '/stream',
  requests: {
    ping: schema.object({ echo: schema.string().allowEmptyString().optional() }).optional(),
    hello: schema.any().optional()
  },
  responses: {
    pong: schema.object({
      body: schema.string()
    }),
    hello: schema.object({
      body: schema.string()
    })
  }
});
```

## Thanks

Thanks for checking it out.  Feel free to create issues or otherwise provide feedback.

[API Docs](https://typescript-oss.github.io/yaschema-ws-api/)

Be sure to check out our other [TypeScript OSS](https://github.com/TypeScript-OSS) projects as well.

<!-- Definitions -->

[downloads-badge]: https://img.shields.io/npm/dm/yaschema-ws-api.svg

[downloads]: https://www.npmjs.com/package/yaschema-ws-api

[size-badge]: https://img.shields.io/bundlephobia/minzip/yaschema-ws-api.svg

[size]: https://bundlephobia.com/result?p=yaschema-ws-api

---
_Source: https://npm.io/package/yaschema-ws-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
