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

@aws-amplify/interactions

Package Overview
Dependencies
Maintainers
9
Versions
1965
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/interactions

Interactions category of aws-amplify

  • 6.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
285K
decreased by-11.97%
Maintainers
9
Weekly downloads
 
Created

What is @aws-amplify/interactions?

@aws-amplify/interactions is a part of the AWS Amplify library that provides a way to interact with AWS services, particularly Amazon Lex, to build conversational interfaces. It allows developers to integrate chatbots and other interactive features into their applications with ease.

What are @aws-amplify/interactions's main functionalities?

Send a message to Amazon Lex

This feature allows you to send a message to an Amazon Lex bot and receive a response. The code sample demonstrates how to configure the Amplify library to connect to a specific Lex bot and send a message to it.

const { Interactions } = require('@aws-amplify/interactions');

// Configure Amplify
Amplify.configure({
  Interactions: {
    bots: {
      'BookTrip': {
        name: 'BookTrip',
        alias: '$LATEST',
        region: 'us-east-1',
      },
    },
  },
});

// Send a message to the bot
async function sendMessage() {
  const response = await Interactions.send('BookTrip', 'I want to book a hotel');
  console.log(response);
}

sendMessage();

Listen for bot responses

This feature allows you to listen for responses from the Amazon Lex bot. The code sample shows how to set up an event listener that triggers when the bot completes its response.

const { Interactions } = require('@aws-amplify/interactions');

// Configure Amplify
Amplify.configure({
  Interactions: {
    bots: {
      'BookTrip': {
        name: 'BookTrip',
        alias: '$LATEST',
        region: 'us-east-1',
      },
    },
  },
});

// Listen for bot responses
Interactions.onComplete('BookTrip', (response) => {
  console.log('Bot response:', response);
});

// Send a message to the bot
async function sendMessage() {
  await Interactions.send('BookTrip', 'I want to book a hotel');
}

sendMessage();

Other packages similar to @aws-amplify/interactions

FAQs

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