question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating Messaging Sessions without the AWS SDK for JavaScript v2

See original GitHub issue

Community Note

  • Please vote for this issue by adding a 👍 reaction to the issue. This will help the community and maintainers from the Amazon Chime SDK team to prioritize this request.
  • Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request.
  • Please go through the existing issues to see if your request has already been recommended.
  • Please do not use this template for bugs or support. Each individual repository has a PR template, documentation and resources for troubleshooting.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Tell us about your request

What do you want us to build?

For the amazon-chime-sdk-js, the ability to create default Messaging Session Configurations and Messaging Sessions without the AWS SDK for JavaScript v2 client. This will enable an easier transition to the AWS SDK for JavaScript v3.

Tell us about the problem you are trying to solve and why is it hard?

Currently, the chime sdk js requires passing in the AWS SDK for JavaScript v2 client when creating a new MessagingSessionConfiguration and DefaultMessagingSession.

Full code snippet from the README:

import * as AWS from 'aws-sdk/global';
import * as Chime from 'aws-sdk/clients/chime';

import {
  ConsoleLogger,
  DefaultMessagingSession,
  LogLevel,
  MessagingSessionConfiguration,
} from 'amazon-chime-sdk-js';

const logger = new ConsoleLogger('SDK', LogLevel.INFO);

// You will need AWS credentials configured before calling AWS or Amazon Chime APIs.
const chime = new Chime({ region: 'us-east-1' });
const endpoint = await chime.getMessagingSessionEndpoint().promise();

const userArn = /* The userArn */;
const sessionId = /* The sessionId */;
const configuration = new MessagingSessionConfiguration(userArn, sessionId, endpoint.Endpoint.Url, chime, AWS);
const messagingSession = new DefaultMessagingSession(configuration, logger);

In the above code snippet, we import the aws-sdk v2 then pass it into the MessagingSessionConfiguration constructor. This seems to be required for the aws-sdk v2 crypto utilities, which are used in the DefaultSigV4.ts file.

How are you currently solving the problem?

Currently, I am using both the AWS SDK for JavaScript v2 and v3 as a workaround. I use the aws-sdk v2 to create the default chime messaging session, then use the aws-sdk v3 for interacting with chime after the session is created. This workaround is working well, but needing both sdk versions is not ideal. It looks like I can maybe create a custom SigV4 signing class and pass it in as a potential alternative workaround, however that seemed like an unnecessary complexity for this scenario.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
michhyun1commented, Nov 19, 2021

@ryanbrown-rcd thanks for bringing this up. We’ll try to get to this as soon as we can.

0reactions
simmkyucommented, Apr 7, 2022

We published the Chime SDK for JavaScript v3. You can now create a messaging session with the AWS SDK for v3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring the SDK for JavaScript - AWS Documentation
Before you use the SDK for JavaScript to invoke web services using the API, you must configure the SDK. At a minimum, you...
Read more >
Amazon SQS examples using SDK for JavaScript V2
The following code examples show you how to perform actions and implement common scenarios by using the AWS SDK for JavaScript V2 with...
Read more >
EventBridge examples using SDK for JavaScript V2
The following code examples show you how to perform actions and implement common scenarios by using the AWS SDK for JavaScript V2 with...
Read more >
AWS SDK for JavaScript v3
The AWS SDK for JavaScript v3 is a rewrite of v2 with some great new features. ... Create a new file called index.js,...
Read more >
Modular packages in AWS SDK for JavaScript
Importing a service client. The service clients are prefixed with client- followed by service name. In v2, the S3 client can be created...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found