Skip to main content
preAuth(properties?) Optionally called before join() to pre-authenticate with the server. This unlocks information that would otherwise only be available after join():
  • accessState() — whether the participant needs to wait in a lobby
  • room() — room and domain configuration
If the Daily bundle isn’t already loaded, preAuth() will load it. It also will give access to the local participant through the participant-updated and participants() method. It will not initialize the local media. To access local devices before joining, use startCamera().
url and token are locked in when preAuth() is called. Attempting to pass different values to join() will result in an error.

Parameters

Takes the same properties as join(). At minimum, provide:
url
string
required
The Daily room URL.
token
string
Technically optional, but should be provided if a meeting token will be used for the call.

Return value

Returns Promise<{ access: DailyAccess }>. access is 'unknown' or { level: 'none' | 'lobby' | 'full' }.

Example

const { access } = await call.preAuth({ url: DAILY_ROOM_URL, token: MEETING_TOKEN });

if (access.level === 'lobby') {
  // Show a waiting room UI before joining
  showWaitingRoom();
} else {
  await call.join({ url: DAILY_ROOM_URL, token: MEETING_TOKEN });
}

See also