Skip to content

Commit 72ea323

Browse files
committed
feat: Call Stats Map
1 parent 620dfa2 commit 72ea323

File tree

4 files changed

+552
-17
lines changed

4 files changed

+552
-17
lines changed

packages/client/src/Call.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import type {
6060
QueryCallMembersResponse,
6161
QueryCallSessionParticipantStatsResponse,
6262
QueryCallSessionParticipantStatsTimelineResponse,
63+
QueryCallStatsMapResponse,
6364
RejectCallRequest,
6465
RejectCallResponse,
6566
RequestPermissionRequest,
@@ -2619,6 +2620,27 @@ export class Call {
26192620
});
26202621
};
26212622

2623+
/**
2624+
* Retrieves the call stats for the current call session in a format suitable
2625+
* for displaying in map-like UIs.
2626+
*/
2627+
getCallStatsMap = async (
2628+
params: {
2629+
start_time?: Date | string;
2630+
end_time?: Date | string;
2631+
exclude_publishers?: boolean;
2632+
exclude_subscribers?: boolean;
2633+
exclude_sfus?: boolean;
2634+
} = {},
2635+
callSessionId: string | undefined = this.state.session?.id,
2636+
): Promise<QueryCallStatsMapResponse> => {
2637+
if (!callSessionId) throw new Error('callSessionId is required');
2638+
return this.streamClient.get<QueryCallStatsMapResponse>(
2639+
`${this.streamClient.baseURL}/call_stats/${this.type}/${this.id}/${callSessionId}/map`,
2640+
params,
2641+
);
2642+
};
2643+
26222644
/**
26232645
* Sends a custom event to all call participants.
26242646
*

0 commit comments

Comments
 (0)