Welcome to the new Daily Docs. Please let us know what you think.

setUserName()

setUserName(name, { thisMeetingOnly: boolean })

Compatibility:
Prebuilt
Custom

Programmatically set the local participant's user name that other participants see.

If using Daily Prebuilt, the set name will be displayed as an overlay on the video stream and in the chat.

If building on the Daily call object, the name will be set via the user_name property in the DailyParticipant object corresponding to the local participant.

First argument is a string which is required; the second is an optional options object as follows: { thisMeetingOnly: boolean }.

Returns a Promise which resolves to the name that was set.