Skip to main content
useLocalSessionId(): string Prefer this over useLocalParticipant() when you only need the session_id, to reduce unnecessary re-renders.

Return value

The local participant’s session_id (a string) is returned by this hook. See the participant properties documentation for more information.

Example

import { useLocalSessionId } from '@daily-co/daily-react';

export const UseLocalSessionIdDemo = () => {
  const localSessionId = useLocalSessionId();

  return <div>Your ID: {localSessionId}</div>;
};

See also