简体   繁体   English

AWS Chime 消息传递:如何使用 JavaScript 将新用户添加到通道 SDK

[英]AWS Chime Messaging: How to add a new user to a channel using the JavaScript SDK

I'm building the back-end of a meeting app that will use AWS Chime Messaging SDK for JavaScript .我正在构建一个会议应用程序的后端,它将使用AWS Chime Messaging SDK for JavaScript The idea is that when a user enters a meeting, an AppInstanceUser is created and associated with the Channel of that meeting.这个想法是,当用户进入会议时,将创建一个AppInstanceUser并将其与该会议的Channel相关联。

Creating the channel and associating the user with it looks quite simple with the JavaScript SDK, however I can't find a way to create the user other than through the CLI , which I don't think is the correct way, because I need to create a new AppInstanceUser for each new user.使用 JavaScript SDK 创建频道并将用户与其相关联看起来非常简单,但是除了通过 CLI之外,我找不到创建用户的方法,我认为这不是正确的方法,因为我需要为每个新用户创建一个新的AppInstanceUser

How should I do this?我应该怎么做? Is there a method to create the AppInstanceUser using the SDK that I didn't find?有没有一种方法可以使用我没有找到的 SDK 创建AppInstanceUser Or is there a way to add the new user to the channel without creating a new AppInstanceUser ?或者有没有办法在不创建新AppInstanceUser的情况下将新用户添加到频道?

AWS SDK provides a client for creating AppInstanceUser's. AWS SDK 提供了一个用于创建 AppInstanceUser 的客户端。 If you are using NodeJS, you can access it with aws-sdk/clients/chime .如果您使用的是 NodeJS,则可以使用aws-sdk/clients/chime访问它。 After you initialize the client, you can call createAppInstanceUser , provide it your AppInstanceArn , AppInstanceUserId and create your users, associate them to channels with createChannelMembership , etc.初始化客户端后,您可以调用createAppInstanceUser ,向其提供您的AppInstanceArnAppInstanceUserId并创建您的用户,使用createChannelMembership将它们关联到频道等。

Last note, you still have to save your AppInstanceUserArn in your user data, then use the stored ARNs in your application, client or server (at least that is my experience).最后一点,您仍然必须将AppInstanceUserArn保存在您的用户数据中,然后在您的应用程序、客户端或服务器中使用存储的 ARN(至少这是我的经验)。

I am not very familiar with how chime sdk meeting works.我不太熟悉 sdk 会议的工作原理。

But If you application requires users to log in to the application, You would create an AppInstanceUser for the user during their onboarding using their userId (example: sub if you're using cognito or database primary key) and associate that user with the AppInstanceUser .但是如果您的应用程序需要用户登录到应用程序,您可以在用户入职期间使用他们的 userId 为用户创建一个AppInstanceUser (例如:如果您使用的是 cognito 或数据库主键,则为 sub)并将该用户与AppInstanceUser相关联。 (example: by storing this in a database column and/or a cognito attribute) (例如:将其存储在数据库列和/或 cognito 属性中)

So whenever a meeting is created you could add all the AppInstanceUsers of the meeting a ChannelMembership for the meeting channel.因此,无论何时创建会议,您都可以将会议的所有 AppInstanceUsers 添加到会议频道的 ChannelMembership。

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-chime-sdk-messaging/index.html - Chime Messaging Client allows you to do things like Adding Channel Membership https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-chime-sdk-messaging/index.html - Chime Messaging Client 允许您执行诸如添加频道成员资格之类的操作

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-chime-sdk-identity/index.html - Chime Identity Client allows you to do things like creating AppInstanceUsers https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-chime-sdk-identity/index.html - Chime Identity Client 允许您执行创建 AppInstanceUsers 等操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何连接到 AWS Chime API? - How to connect to AWS Chime API? 如何使用 javascript sdk 获取 aws lambda 调用计数 - how to get aws lambda invocation count using javascript sdk 如何在不使用 AWS Pinpoint 或 Twilio 的情况下通过短信实现 Lex 和用户之间的双向通信 - How to implement 2-way communication between Lex and a user through text messaging without using AWS Pinpoint or Twilio 如何使用 AWS Javascript SDK 从 EC2 实例连接其他 AWS 云服务? - How to connect other AWS cloud service from an EC2 instance using AWS Javascript SDK? 可以使用 amazon chime 自动回复或自动发送消息吗? - Auto reply or auto messaging with amazon chime possible? 无法使用 AWS SDK 为 Java 2.x 添加新的备用域名到 CloudFront 资源 - Can't add new alternative domain name to CloudFront resource using AWS SDK for Java 2.x 使用 AWS SDK 帮助调用并允许用户在 JavaScript 中创建跟踪器 API? - Using AWS SDK to help call and allow a user create a tracker API in JavaScript? 如何使用 aws-sdk Javascript 获取 EC2 public ip - How to get EC2 public ip using aws-sdk Javascript 如何使用 spring-cloud-aws-messaging 或 aws-java-sdk 设置 AWS SNS 消息属性值? - How do I set AWS SNS message attribute values with spring-cloud-aws-messaging or aws-java-sdk? 如何使用 AWS SDK 部署特定堆栈? - How to deploy a specific stack using AWS SDK?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM