# @appport/server

> Server-side AppPort protocol runtime with HTTP and WebSocket bindings.

Latest version **1.0.1** (published 2026-09-24) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @appport/server
pnpm add @appport/server
yarn add @appport/server
bun add @appport/server
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2026-09-24 |
| First published | 2026-09-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 113.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rkendel |

## Links

- npm: https://www.npmjs.com/package/@appport/server
- Repository: https://github.com/rkendel1/appport
- Homepage: https://github.com/rkendel1/appport#readme
- Issues: https://github.com/rkendel1/appport/issues
- npm.io page: https://npm.io/package/@appport/server

## Dependencies (3)

- [@appport/core](https://npm.io/package/@appport/core.md) 1.0.2
- [@appport/protocol](https://npm.io/package/@appport/protocol.md) 1.0.1
- [@appport/authorization](https://npm.io/package/@appport/authorization.md) 1.0.1

## Recent versions

- 1.0.1 (latest) — 2026-09-24
- 1.0.0 — 2026-09-21

## README

# @appport/server

The server-side protocol runtime and its web bindings.

```ts
import { createServer } from "@appport/server";
import { serve } from "@appport/server/node";

const server = createServer({
  application,
  authenticate: ({ sessionId }) => sessions.resolve(sessionId)
});

const running = await serve({ server, port: 4400, cors: { origins: "*" } });
```

`serve` exposes, against one capability server:

| Route                    | Purpose                                 |
| ------------------------ | --------------------------------------- |
| `POST /appport`          | requests, and streams as NDJSON          |
| `GET /appport/events`    | events as Server-Sent Events             |
| `GET /appport/manifest`  | the manifest                             |
| `GET /.well-known/appport` | discovery                              |
| `WS /appport/ws`         | the WebSocket binding                    |

The WebSocket endpoint is a dependency-free RFC 6455 implementation: framing,
fragmentation, ping/pong and close, with one AppPort envelope per message.

`AppPortConnection` is the duplex half used by WebSocket, IPC and in-process
transports. It owns subscription and stream bookkeeping, so unsubscribe releases
resources and cancellation reaches the handler.

For edge runtimes, `createFetchHandler(binding)` returns a standard
`(Request) => Promise<Response>`.

`authenticate` resolves an identity from transport-supplied credentials. AppPort
does not authenticate; it represents the resulting identity, and authorizes every
capability regardless of which transport delivered it.

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