Last active
February 4, 2021 13:35
-
-
Save dabit3/1308812f6780d1735e3313487819c7fa to your computer and use it in GitHub Desktop.
Dealing with Chime SDK for creating rooms & attendees
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* On the server */ | |
const AWS = require('aws-sdk') | |
const chime = new AWS.Chime({ region: 'us-east-1' }) | |
// create a room | |
const meeting = await chime.createMeeting({ | |
ClientRequestToken: uuid(), | |
MediaRegion: 'us-east-1' | |
}).promise() | |
// add an attendee to a room | |
const attendeeResponse = await chime.createAttendee({ | |
MeetingId: meetingId, | |
ExternalUserId: 'some-unique-subject-id' | |
}).promise() | |
// get a room | |
const room = await chime.getMeeting({ | |
MeetingId: meetingId | |
}).promise() | |
// remove a user from a room | |
await chime.deleteAttendee({ | |
MeetingId: meetingId, | |
AttendeeId: attendeeId | |
}).promise() | |
// close a room | |
await chime.deleteMeeting({ MeetingId: meetingId }) | |
.promise() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Lambda you use for the Chime SDK is likely these IAM permissions.
I recommend avoiding doing
chime:*
.