Skip to content

Narrow down WebhookEvent type by event.event value #513

@thebishalniroula

Description

@thebishalniroula

Describe the problem

Hi. I want to be able to narrow down WebhookEvent type based on what event i received so that i can strictly let my event handlers know what to expect.

Currently there is no way of narrowing down WebhookEvent type for example to only include properties associated with 'egress_ended' event.

Describe the proposed solution

I would love it if i was able to narrow down WebhookEvent like below:

if(event.event==="egress_ended"){
  console.log(event.track) // This should throw error in build
}

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions