Valora
API Reference@valora-ai/reactindexFunctions

useParticipantContext

function useParticipantContext(): unknown;

Defined in: packages/react/src/hooks/participant/useParticipantContext.ts:21

Ensures that a participant is provided via context. If not inside a ParticipantContext, an error is thrown.

Returns

unknown

Example

function ContextualParticipantName() {
  const participant = useParticipantContext();
  const { identity, name } = useParticipantInfo({ participant });
  return <span>{name ?? identity}</span>;
}

<ParticipantContext.Provider value={{ identity: "local-user", name: "You" }}><ContextualParticipantName /></ParticipantContext.Provider>;

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub