Skip to main content
once(eventName, callback) Subscribes to a Daily call event and fires the callback exactly once, then automatically removes the listener. Follows the Node.js EventEmitter interface. Returns this, so calls can be chained.

Parameters

eventName
DailyEvent
required
The event name to subscribe to. See the Events reference for all available events.
callback
function
required
Function called when the event fires. Automatically removed after the first invocation.

Return value

Returns this (the DailyCall instance) for chaining.

Example

// Wait for the first joined-meeting event, then stop listening
call.once('joined-meeting', ({ participants }) => {
  console.log('Joined for the first time:', participants);
});

See also

Methods

Guides