API Gateway WebSocket Management API

@aws-lite/apigatewaymanagementapi

Maintained by: @architect

Install

npm i @aws-lite/apigatewaymanagementapi

Optionally install types:

npm i -D @aws-lite/apigatewaymanagementapi-types

Methods

PostToConnection

Canonical AWS API doc

Properties

ConnectionId (string) [required]

WebSocket connection ID

ApiId (string)

API Gateway ID

ApiUrl (string)

Full API Gateway WebSocket URL, including stage; if using this, do not use ApiId and Stage; example: wss://abc123.execute-api.us-west-1.amazonaws.com/$default

Data (string, object)

Data to send to WebSocket client

Stage (string)

API Gateway stage; example: $default

Example

await aws.ApiGatewayManagementApi.PostToConnection({
  ConnectionId: String, // required
  ApiId: String,
  ApiUrl: String,
  Data: String || Object,
  Stage: String,
})

DeleteConnection

Canonical AWS API doc

Properties

ConnectionId (string) [required]

WebSocket connection ID

ApiId (string)

API Gateway ID

ApiUrl (string)

Full API Gateway WebSocket URL, including stage; if using this, do not use ApiId and Stage; example: wss://abc123.execute-api.us-west-1.amazonaws.com/$default

Stage (string)

API Gateway stage; example: $default

Example

await aws.ApiGatewayManagementApi.DeleteConnection({
  ConnectionId: String, // required
  ApiId: String,
  ApiUrl: String,
  Stage: String,
})

GetConnection

Canonical AWS API doc

Properties

ConnectionId (string) [required]

WebSocket connection ID

ApiId (string)

API Gateway ID

ApiUrl (string)

Full API Gateway WebSocket URL, including stage; if using this, do not use ApiId and Stage; example: wss://abc123.execute-api.us-west-1.amazonaws.com/$default

Stage (string)

API Gateway stage; example: $default

Example

await aws.ApiGatewayManagementApi.GetConnection({
  ConnectionId: String, // required
  ApiId: String,
  ApiUrl: String,
  Stage: String,
})
aws-lite is an Apache 2.0-licensed open source project under the umbrella of OpenJS Foundation Architect. aws-lite is not in any way affiliated with Amazon Web Services, Inc. (AWS). All names and trademarks are the property of their respective owners.