By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How do I invoke a lambda function on IVS stage participant event?

0

We've a system set up for creating IVS stage and enabling users to join the stage but we need to monitor who has joined when at server side, I did find that list-participant-events gives list of all the events for that particular participant, I can also see all the events of participant such as Participant joined in ivs stage > session > participant > events as shown in the image below Enter image description here

But when I checked out https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/eventbridge.html I could only find Participant Published, Participant Unpublished events that I could subscribe to by creating a rule on IVS Stage Update but I could not find any events for Participant joined event

I could not find any info on how can I subscribe my lambda function to Participant joined event nor I could find that log generated when I set up a event rule on all ivs events, I could only see the logs when I called ListParticipantEvents API

Any help is appriciated, and please let me know if even it's possible to invoke my lambda on that event or if you have any workaround if it's not possible out of the box

Steps to reproduce:

  1. Create a IVS stage
  2. Publish to the stage from the console
  3. join with a participant token (Permission only to subscribe not publish)
  4. Join the stage via https://codepen.io/amazon-ivs/project/editor/ZzWobn
  5. Navigate to stage in console, then to sessions > <session id> > participants > <yout participant ID> if you scroll down you will be able to see Participant joined and other detailed events
  6. Now create a dummy lambda function and log the incoming event > Navigate to Cloud watch > Rules > Create rule > Ivs > All (For all logs just to be sure or select IVS stage update)
  7. Follow the steps from 1 to 3 then monitor lambda function cloud watch logs, there wont be any logs related to participant joined

thanks in advance!

1 Answer
0

Based on the information provided and the current AWS IVS (Interactive Video Service) capabilities, it appears that there isn't a direct way to invoke a Lambda function specifically for the "Participant joined" event using EventBridge rules for IVS Stage.

The IVS Stage Update events that can be subscribed to through EventBridge currently include "Participant Published" and "Participant Unpublished", but not "Participant joined". This limitation means you can't directly trigger a Lambda function when a participant joins an IVS stage using the EventBridge integration.

However, there are a few potential workarounds you could consider:

  1. Polling approach: You could set up a Lambda function that periodically calls the ListParticipantEvents API. This function could run on a schedule (e.g., every minute) and check for new "Participant joined" events. While not real-time, this approach would allow you to process join events on the server-side.

  2. Client-side notification: If possible, you could modify your client-side application to make an API call to your backend (which could then trigger a Lambda function) when a participant successfully joins a stage. This would require changes to your client code but would provide real-time notifications.

  3. Use "Participant Published" as a proxy: In some cases, participants might publish to the stage shortly after joining. You could potentially use the "Participant Published" event as an approximate indicator of a join event, although this wouldn't capture participants who join but don't publish.

  4. AWS Support: Given that you can see the "Participant joined" event in the IVS console, you might want to contact AWS Support to inquire if there are plans to make this event available through EventBridge in the future, or if there's an alternative method to capture this event that isn't currently documented.

Remember that while these workarounds can help you track join events, they each have limitations and may not provide the exact real-time monitoring you're looking for. The best long-term solution would be for AWS to add support for the "Participant joined" event in EventBridge for IVS Stage, which you might want to request as a feature if it's critical for your use case.
Sources
Invoking Lambda with events from other AWS services - AWS Lambda
LambdaInvoke - AWS CodePipeline
Use scheduled events to invoke a Lambda function - AWS SDK Code Examples

profile picture
answered 23 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions