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

@aws-sdk/client-iot

Package Overview
Dependencies
Maintainers
5
Versions
443
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-iot

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

  • 3.723.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

What is @aws-sdk/client-iot?

@aws-sdk/client-iot is a part of the AWS SDK for JavaScript, which allows developers to interact with AWS IoT services. This package provides a variety of functionalities to manage IoT devices, policies, certificates, and more. It enables developers to build IoT applications that can securely interact with AWS IoT Core.

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

CreateThing

This feature allows you to create a new IoT thing (device) in AWS IoT Core. The code sample demonstrates how to create a thing named 'MyIoTDevice'.

const { IoTClient, CreateThingCommand } = require('@aws-sdk/client-iot');

const client = new IoTClient({ region: 'us-west-2' });
const params = { thingName: 'MyIoTDevice' };
const command = new CreateThingCommand(params);

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

ListThings

This feature allows you to list all IoT things (devices) in your AWS IoT Core. The code sample demonstrates how to retrieve and log the list of things.

const { IoTClient, ListThingsCommand } = require('@aws-sdk/client-iot');

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

client.send(command).then(
  (data) => console.log(data.things),
  (error) => console.error(error)
);

AttachPolicy

This feature allows you to attach a policy to an IoT thing (device). The code sample demonstrates how to attach a policy named 'MyPolicy' to a specific IoT device.

const { IoTClient, AttachPolicyCommand } = require('@aws-sdk/client-iot');

const client = new IoTClient({ region: 'us-west-2' });
const params = { policyName: 'MyPolicy', target: 'arn:aws:iot:us-west-2:123456789012:thing/MyIoTDevice' };
const command = new AttachPolicyCommand(params);

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

CreateCertificate

This feature allows you to create a new certificate for an IoT thing (device). The code sample demonstrates how to create a new certificate and set it as active.

const { IoTClient, CreateKeysAndCertificateCommand } = require('@aws-sdk/client-iot');

const client = new IoTClient({ region: 'us-west-2' });
const command = new CreateKeysAndCertificateCommand({ setAsActive: true });

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);
0

FAQs

Package last updated on 06 Jan 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