We are using plain Javascript without any frameworks like ReactJS etc.
Generate Amazon Chime SDK Javascript Client Library - single file
git clone https://github.com/aws-samples/amazon-chime-sdk.git
cd amazon-chime-sdk/utils/singlejs
Here make sure that src/index.js looks like this (update it if necessary):
export * as default from 'amazon-chime-sdk-js';
npm install
npm run bundle
This will generate amazon-chime-sdk.min.js in build directory.
Lambda function
services/lambda/lambda.py
Make sure that the chime.endpoint region is correct here.
HTML file
web/index.html
The website can be accessed by using <CloudFrontURL>
Javascript Code
web/assets/js/vid.js
Here you must set the MEETING_SERVICE constant to point to your API ( API Gateway > Lambda function)
How to create an API (Gateway)
Create API
In AWS Console > API Gateway > Create API > Choose API Type > HTTP API > Build >
Provide API Name 'byte-meeting' > For 'Configure Routes' Hit Next > For 'Configure Stages' Hit Next > Review & Create
Configure Routes
Select Routes on left menu > Hit 'Create' on right pane > Choose Method 'ANY' Route '/bytes-meeting' > Create >
Select the newly created route/method > Select 'Attach Integration' > 'Create and Attach Integration'
Choose Integration Target - Integration Type from dropdown : Lambda function , Choose AWS Region ,
Select 'bytes-meeting' lambda function ARN
Make sure "Grant API Gateway permission to invoke your Lambda function" is checked > Hit Create
Deploy API
Select Deploy menu on left > Select Stages > Select your stage $default
Check if under Attached Deployment: Automatic Deployment is Enabled. If yes, you are all set.
If not you must hit the Deploy button at top right to deploy your API