# aws-post-to-connection

> post to a connected websocket client via api gateway

Latest version **0.1.21** (published 2020-11-20) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install aws-post-to-connection
pnpm add aws-post-to-connection
yarn add aws-post-to-connection
bun add aws-post-to-connection
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.21 |
| Published | 2020-11-20 |
| First published | 2019-01-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 24.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | James Kyburz |
| Maintainers | jameskyburz |
| Keywords | aws, lambda, websocket, api-gateway |

## Links

- npm: https://www.npmjs.com/package/aws-post-to-connection
- Repository: https://github.com/jameskyburz/aws-lambda-ws-server
- Homepage: https://github.com/jameskyburz/aws-lambda-ws-server#readme
- Issues: https://github.com/jameskyburz/aws-lambda-ws-server/issues
- npm.io page: https://npm.io/package/aws-post-to-connection

## Dependencies (1)

- [aws4](https://npm.io/package/aws4.md) 1.11.0

## 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

- 0.1.21 (latest) — 2020-11-20
- 0.1.20 — 2020-03-30
- 0.1.19 — 2020-03-30
- 0.1.18 — 2020-02-15
- 0.1.17 — 2020-01-04
- 0.1.16 — 2020-01-04
- 0.1.15 — 2020-01-04
- 0.1.12 — 2020-01-03
- 0.1.11 — 2020-01-03
- 0.1.7 — 2020-01-02
- 0.1.6 — 2020-01-02
- 0.1.4 — 2020-01-02
- 0.1.2 — 2019-02-01
- 0.1.1 — 2019-01-13
- 0.1.0 — 2019-01-13
- … 1 more at https://npm.io/package/aws-post-to-connection/versions

## README

# aws-post-to-connection

[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/feross/standard)
[![build status](https://api.travis-ci.org/JamesKyburz/aws-lambda-ws-server.svg)](https://travis-ci.org/JamesKyburz/aws-lambda-ws-server)
[![downloads](https://img.shields.io/npm/dm/aws-post-to-connection.svg)](https://npmjs.org/package/aws-post-to-connection)

post to a connected websocket client.

### usage

```javascript
const PostToConnection = require('aws-post-to-connection')

// post to same gateway
const postToSameGateway = PostToConnection(event)
await postToSameGateway({ message: 'hello' }, 'connectionId')

// post to another gateway
const postToAnotherGateway = PostToConnection({
  stage: 'stage',
  domainName: '<apiId>.execute-api.<region>.amazonaws.com'
})
await postToConnection({ message: 'hello' }, 'connectionId')

// post to local websocket server
const postToLocalhost = PostToConnection({
  stage: 'stage',
  domainName: 'localhost',
  port: 5000,
  secure: false
})
await postToConnection({ message: 'hello' }, 'connectionId')
```

Works locally and in a lambda function.

# license
[Apache License, Version 2.0](LICENSE)

---
_Source: https://npm.io/package/aws-post-to-connection · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
