diff --git a/src/replay/index.ts b/src/replay/index.ts index 6c6537ea..aa780700 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -254,6 +254,16 @@ export class Replayer { case EventType.DomContentLoaded: case EventType.Load: break; + case EventType.Custom: + castFn = () => { + /** + * emit custom-event and pass the event object. + * + * This will add more value to the custom event and allows the client to react for custom-event. + */ + this.emitter.emit(ReplayerEvents.CustomEvent, event); + }; + break; case EventType.Meta: castFn = () => this.emitter.emit(ReplayerEvents.Resize, { diff --git a/src/types.ts b/src/types.ts index 9a88ef12..44567c7c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -366,4 +366,5 @@ export enum ReplayerEvents { SkipEnd = 'skip-end', MouseInteraction = 'mouse-interaction', EventCast = 'event-cast', + CustomEvent = 'custom-event', }