Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-apigatewaymanagementapi

Package Overview
Dependencies
Maintainers
5
Versions
415
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-apigatewaymanagementapi

AWS SDK for JavaScript Apigatewaymanagementapi Client for Node.js, Browser and React Native

  • 3.709.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is @aws-sdk/client-apigatewaymanagementapi?

@aws-sdk/client-apigatewaymanagementapi is a part of the AWS SDK for JavaScript. It allows developers to interact with the Amazon API Gateway Management API, which is used to send messages to connected clients in a WebSocket-based API Gateway.

What are @aws-sdk/client-apigatewaymanagementapi's main functionalities?

PostToConnection

This feature allows you to send a message to a specific connection in a WebSocket-based API Gateway. The code sample demonstrates how to use the PostToConnectionCommand to send a message to a client identified by a connection ID.

const { ApiGatewayManagementApiClient, PostToConnectionCommand } = require('@aws-sdk/client-apigatewaymanagementapi');

const client = new ApiGatewayManagementApiClient({ region: 'us-west-2' });

const params = {
  ConnectionId: 'abc123',
  Data: Buffer.from('Hello, World!')
};

const command = new PostToConnectionCommand(params);

client.send(command).then(
  (data) => {
    console.log('Message sent:', data);
  },
  (error) => {
    console.error('Error:', error);
  }
);

DeleteConnection

This feature allows you to delete a specific connection in a WebSocket-based API Gateway. The code sample demonstrates how to use the DeleteConnectionCommand to delete a client connection identified by a connection ID.

const { ApiGatewayManagementApiClient, DeleteConnectionCommand } = require('@aws-sdk/client-apigatewaymanagementapi');

const client = new ApiGatewayManagementApiClient({ region: 'us-west-2' });

const params = {
  ConnectionId: 'abc123'
};

const command = new DeleteConnectionCommand(params);

client.send(command).then(
  (data) => {
    console.log('Connection deleted:', data);
  },
  (error) => {
    console.error('Error:', error);
  }
);

Other packages similar to @aws-sdk/client-apigatewaymanagementapi

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc