Giter VIP home page Giter VIP logo

Comments (6)

Swethamr402 avatar Swethamr402 commented on June 17, 2024 3

HI Team
Finally I got solution

import AWS from "aws-sdk"
import "amazon-connect-streams";
import "amazon-connect-chatjs";

This is the procedure

from amazon-connect-chatjs.

Swethamr402 avatar Swethamr402 commented on June 17, 2024

Hi Team,
Can you please help me what I am doing wrong?

from amazon-connect-chatjs.

Swethamr402 avatar Swethamr402 commented on June 17, 2024

HI Team,

I got to know that, aws-sdk is giving problem, but I am not sure how to resolve it.

Scenario 2: Streams and ChatJS are used. You are importing the AWS SDK.
Import Streams, then ChatJS, then the SDK. Ensure that your AWS SDK includes the ConnectParticipant Service (it is relatively new, so make sure you have an up-to-date AWS SDK version [^2.597.0]).

I am using this scenario.

<script src="js/amazon-cognito-auth.min.js"></script>
<script type="text/javascript" src="js/amazon-connect-1.5.0.js"></script>

  <script src="js/amazon-connect-chat-interface.js"></script>

<script src="https://sdk.amazonaws.com/js/aws-sdk-2.597.0.min.js"></script>

here its is written like this,
A note for Scenarios 2 and 4.
When using the SDK and ChatJS, you may remove the SDK from ChatJS to ensure lack of import conflicts. However, this should not be relevant if the order in which you are importing these libraries is the order reflected above.

How do I remove aws-sdk from chatJS file ??

from amazon-connect-chatjs.

cbgandhi avatar cbgandhi commented on June 17, 2024

I am facing same error, can you please provide more details.

If I am using following code, what do I need to change?

<script type="text/javascript" src="js/connect-streams.js"></script>
<script type="text/javascript" src="js/amazon-connect-chat.js"></script>
<script type="module" src= js/aws-sdk-2.824.0.min.js></script>

from amazon-connect-chatjs.

ashokdevlabs avatar ashokdevlabs commented on June 17, 2024

Trying to connect connectParticipant service using aws-sdk but it giving error like below.

TypeError: aws_sdk__WEBPACK_IMPORTED_MODULE_5___default.a.ConnectParticipant is not a constructor

Please find the sample request below.
var params = {
ParticipantToken: ParticipantToken, // ParticipateToken from StartContactChat response
Type: [
"WEBSOCKET","CONNECTION_CREDENTIALS"
]
};

var connectparticipant = new AWS.ConnectParticipant({apiVersion: '2018-09-07'});

connectparticipant.createParticipantConnection(params, function(err, data) {
  if (err) console.log(err, err.stack); 
  else     console.log(data); 
});

Could anyone help me with an example to resolve this issue.

from amazon-connect-chatjs.

learnforevergo avatar learnforevergo commented on June 17, 2024

HI Team Finally I got solution

import AWS from "aws-sdk" import "amazon-connect-streams"; import "amazon-connect-chatjs";

This is the procedure

Hello Swethamr402,

I am struggling with the problem as well. I follow the instruction https://github.com/amazon-connect/amazon-connect-chatjs.

The AWS-SDK is, by default, included in ChatJS as a "baked-in" dependency. You can view it at ./client/aws-sdk-connectparticipant.js. In ./client/client.js we import ConnectParticipant from this file. This file and import can be removed while using the AWS SDK imported through a script in the page file of your application, assuming that version of the AWS SDK has the ConnectParticipant service included. Incidentally, Amazon Connect Streams also contains a "baked-in" AWS SDK. This SDK cannot be removed, as it contains unreleased APIs that will not be available in the SDK you include as a script in the page file. Therefore, there are several occasions where implementations can run into AWS SDK issues.

Scenario 4: ChatJS only, with AWS SDK import.
Import ChatJS before the AWS SDK, and ensure the AWS SDK version you are using contains the ConnectParticipant Service.

However, it doesn't work. I am using the AWS SDK Version
https://sdk.amazonaws.com/js/aws-sdk-2.824.0.min.js

However, I still get the error such as
catch error for running contact.getAgentConnectionTypeError: AWS.ConnectParticipant is not a constructorException StackTypeError: AWS.ConnectParticipant is not a constructor
at new t (https://.../v2/web_site/js/amazon-connect-chat.js:1:17100)
at e.value (https://.../v2/web_site/js/amazon-connect-chat.js:1:16856)
at e.value (https://.../v2/web_site/js/amazon-connect-chat.js:1:16687)
at t.value (https://.../v2/web_site/js/amazon-connect-chat.js:1:42194)
at t.value (https://.../v2/web_site/js/amazon-connect-chat.js:1:41865)
at Object.create (https://.../v2/web_site/js/amazon-connect-chat.js:1:43880)
at createMediaInstance (https://.../v2/web_site/js/connect-streams.js:27073:50)
at Object.get (https://.../v2/web_site/js/connect-streams.js:27116:24)
at getMediaController (https://.../v2/web_site/js/connect-streams.js:27165:137)
at Object.get (https://.../v2/web_site/js/connect-streams.js:27184:24)

May I kindly ask you to share your solution. Where do you place the code, you mentioned it above? Thank you!

from amazon-connect-chatjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.