most-vr-18651
03/27/2025, 11:54 AMdestination_identity
in the perform_rpc
call matches the identity of the frontend participant you want to communicate with.
how do I get the identity: what does the code refers to identity
@room.local_participant.register_rpc_method("greet")
async def handle_greet(data: RpcInvocationData):
print(f"Received greeting from {data.caller_identity}: {data.payload}")
return f"Hello, {data.caller_identity}!"
tall-airline-16756
03/27/2025, 11:54 AMtall-airline-16756
03/27/2025, 11:54 AMidentity
in the perform_rpc
call refers to the unique identifier of a participant in the room. This is used to target a specific participant for the RPC call. In your provided code, you can retrieve the identity of the caller using the caller_identity
property of the RpcInvocationData
object. This property contains the identity of the remote participant who initiated the RPC call.
Sources: performRpc | callerIdentity | RpcInvocationDatamost-vr-18651
03/27/2025, 11:56 AMtall-airline-16756
03/27/2025, 11:56 AMdestinationIdentity
parameter in the perform_rpc
function must be manually specified. It does not have a default value and requires you to explicitly set the identity of the participant you want to target for the RPC call. You can refer to the Participant.Identity documentation for more details.
Sources: livekit.rtc API documentation | PerformRpcParams | LiveKit JS Client SDK - v2.8.1most-vr-18651
03/27/2025, 11:57 AMtall-airline-16756
03/27/2025, 11:57 AMParticipant.Identity
in LiveKit is a string value that uniquely identifies a participant in a room. For instance, it could be something like "user123"
or "john_doe"
. This identity is unique per room, and if multiple participants with the same identity join, only the most recent one will remain active.
Sources: Participant | identity | Core API primitives | LiveKit Docs | Identity