New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-iot-data-plane

Package Overview
Dependencies
Maintainers
0
Versions
427
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-iot-data-plane

AWS SDK for JavaScript Iot Data Plane Client for Node.js, Browser and React Native

  • 3.758.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
134K
decreased by-17.72%
Maintainers
0
Weekly downloads
 
Created

What is @aws-sdk/client-iot-data-plane?

@aws-sdk/client-iot-data-plane is an AWS SDK for JavaScript package that allows developers to interact with the AWS IoT Data Plane. This package provides methods to publish messages to IoT topics, retrieve the current state of a device shadow, update a device shadow, and delete a device shadow.

What are @aws-sdk/client-iot-data-plane's main functionalities?

Publish to IoT Topic

This feature allows you to publish a message to a specified IoT topic. The code sample demonstrates how to create a client, construct a PublishCommand with a topic and payload, and send the command.

{"import":"import { IoTDataPlaneClient, PublishCommand } from '@aws-sdk/client-iot-data-plane';","client":"const client = new IoTDataPlaneClient({ region: 'us-west-2' });","command":"const command = new PublishCommand({ topic: 'my/topic', payload: Buffer.from('Hello, world!') });","send":"await client.send(command);"}

Get Device Shadow

This feature allows you to retrieve the current state of a device shadow. The code sample demonstrates how to create a client, construct a GetThingShadowCommand with a device name, send the command, and log the response.

{"import":"import { IoTDataPlaneClient, GetThingShadowCommand } from '@aws-sdk/client-iot-data-plane';","client":"const client = new IoTDataPlaneClient({ region: 'us-west-2' });","command":"const command = new GetThingShadowCommand({ thingName: 'MyDevice' });","send":"const response = await client.send(command);","response":"console.log(new TextDecoder('utf-8').decode(response.payload));"}

Update Device Shadow

This feature allows you to update the state of a device shadow. The code sample demonstrates how to create a client, construct an UpdateThingShadowCommand with a device name and payload, send the command, and log the response.

{"import":"import { IoTDataPlaneClient, UpdateThingShadowCommand } from '@aws-sdk/client-iot-data-plane';","client":"const client = new IoTDataPlaneClient({ region: 'us-west-2' });","command":"const command = new UpdateThingShadowCommand({ thingName: 'MyDevice', payload: Buffer.from(JSON.stringify({ state: { desired: { key: 'value' } } })) });","send":"const response = await client.send(command);","response":"console.log(new TextDecoder('utf-8').decode(response.payload));"}

Delete Device Shadow

This feature allows you to delete a device shadow. The code sample demonstrates how to create a client, construct a DeleteThingShadowCommand with a device name, send the command, and log the response.

{"import":"import { IoTDataPlaneClient, DeleteThingShadowCommand } from '@aws-sdk/client-iot-data-plane';","client":"const client = new IoTDataPlaneClient({ region: 'us-west-2' });","command":"const command = new DeleteThingShadowCommand({ thingName: 'MyDevice' });","send":"const response = await client.send(command);","response":"console.log(new TextDecoder('utf-8').decode(response.payload));"}

Other packages similar to @aws-sdk/client-iot-data-plane

FAQs

Package last updated on 27 Feb 2025

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