Skip to navigation

executeMethod

View as MarkdownOpen in Claude
executeMethod<T>(target, method, args): Promise<T>

Executes a Verto RPC method targeting a specific participant.

Constructs call context (node_id, call_id, member_id) and sends the RPC request. This is the transport behind every Call and Participant control method — reach for those first; use executeMethod only for verbs the SDK does not wrap.

Type Parameters

Type ParameterDefault type
T extends JSONRPCResponseJSONRPCResponse

Parameters

target
string | MemberTargetRequired

A MemberTarget triple, or the local member’s ID string for self-operations. Any other string is rejected: a bare member ID cannot carry a remote member’s own call context, and the backend routes by that context. For a remote member, pass participant.target.

The examples below require a value typed as WebRTCCall. The Call interface that dial() returns declares target as string only, so a MemberTarget needs a narrowed type — prefer the Participant control methods, which build the target for you.

method
stringRequired

Verto method name (e.g. 'call.mute', 'call.member.remove').

args
Record<string, unknown>Required

Parameters for the RPC method.

Returns

Promise<T>

The RPC response.

Throws

  • CallNotReadyError — the call has no self member context yet.
  • InvalidParams — a string target is not the local member’s ID.
  • JSONRPCError — the RPC call returned an error.

Examples

Mute a remote member

await call.executeMethod(participant.target, 'call.mute', { channels: ['audio'] });

Remove a member from the call

await call.executeMethod(participant.target, 'call.member.remove', {});

See

  • execute — lower-level raw JSON-RPC send.