Daily Functions
The functions of the Daily adapter handle interactions with the Daily video conferencing service.
Importing the adapter
import { dailyAdapter } from 'epicenter-libs';
The dailyAdapter namespace exports functions that make calls to the Daily API.
For descriptions of the objects used by the Daily adapter functions, read Daily Entities.
Create
Create Daily meeting room
The createRoom() function creates a metadata object for the video conference and returns the conference-room name and the URL participants use to join the call. Each participant requires a meeting room token. To create one, call the createToken() function.
Permissions
Requires a role of PARTICIPANT or higher.
Function description
- Constructs a
POSTrequest to the/daily/v1/roomendpoint. - The new Daily meeting room is scoped to a project, group, episode, or user.
- Supports configuring read/write permissions, privacy, recording options, TTL, expiration, and streaming endpoints.
- Automatically retries on rate limits unless disabled.
export async function createRoom(
scope: { userKey?: string } & GenericScope,
optionals: {
readLock?: keyof typeof ROLE;
writeLock?: keyof typeof ROLE;
privacy?: Privacy;
ttlSeconds?: number;
exp?: number;
enable_recording?: RecordingType;
disableRateLimitHandling?: boolean;
streaming_endpoints?: [{
name: string;
type: StreamType;
hls_config: {
storage: {
path: string;
bucket_region?: string;
assume_role_arn?: string;
bucket_name?: string;
};
save_hls_recording?: boolean;
};
}];
} & RoutingOptions = {},
): Promise<DailyRoomResponseReadOutView>
Parameters
scope({ userKey?: string } & GenericScope) – The scope of the roomscopeBoundary– Scope entityscopeKey(string) – Unique identifier for the scopeuserKey?(string) – Optional user key for user-specific scope
optionals(Type: object &RoutingOptions, optional) – Additional room configuration and routing options.readLock?(keyof typeof ROLE) – Read lock part of the permitwriteLock?(keyof typeof ROLE) – Write lock part of the permitttlSeconds?(number) – How long Epicenter should store the recording Defaults to 604,800 seconds (1 week). Maximum value: 31,536,000 seconds.privacy?(Privacy) – Whether the room is private (currently only'PRIVATE')exp?(number) – When the room expires (epoch seconds). Both the maximum and the default are 24 hours.enable_recording?(RecordingType) – Recording method (currently only'CLOUD')disableRateLimitHandling?(boolean) – Disable automatic retry on rate limitsstreaming_endpoints?(Array) – Streaming configurationname(string) – Stream nametype(StreamType) – Stream type (currently only'HLS')hls_config– HLS configurationstorage.path(string) – S3 storage pathstorage.bucket_region?(string) – S3 bucket regionstorage.assume_role_arn?(string) – IAM role ARN for S3 accessstorage.bucket_name?(string) – S3 bucket namesave_hls_recording?(boolean) – Whether to save HLS recordings
Return value
A promise that resolves to a DailyRoomResponseReadOutView object containing details of the newly created room.
Usage example
import { dailyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';
const room = await dailyAdapter.createRoom({
scopeBoundary: SCOPE_BOUNDARY.GROUP,
scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',
});
Create Daily meeting token
A token is used by a user to join a video conferencing call. To create a token for a Daily meeting room, use the createToken() function.
Permissions
Requires a role of PARTICIPANT or higher.
Function description
- Constructs a
POSTrequest to the/daily/v1/meetingTokenendpoint. - Supports configuring video state, ownership permissions, username, tab‑closing behavior, expiration, and recording permissions.
- Automatically retries on rate limits unless disabled.
- Supports self‑signing the token.
export async function createToken(
room_name: string,
optionals: {
start_video_off?: boolean;
is_owner?: boolean;
user_name?: string;
close_tab_on_exit?: boolean;
exp?: number;
enable_recording?: RecordingType;
disableRateLimitHandling?: boolean;
selfSign?: boolean;
} & RoutingOptions = {},
): Promise<DailyMeetingTokenResponseReadOutView>
Parameters
room_name(string) – Name of the room to create a token for.optionals(Type: object &RoutingOptions, optional) – Additional token configuration and routing options.start_video_off?(boolean) – Whether the user’s video should be off when joining (default:true).is_owner?(boolean) – Whether the user has owner permissions (required to start a stream; default:false).user_name?(string) – Username to display in Daily’s system (useful when the call opens in a separate window).close_tab_on_exit?(boolean) – Whether to close the tab when the call ends (for separate‑window calls).exp?(number) – When the token expires (epoch seconds). Defaults to 24 hours; max 24 hours.enable_recording?(RecordingType) – Recording method permitted for the token (currently only'CLOUD').disableRateLimitHandling?(boolean) – Disable automatic retry on rate limits.selfSign?(boolean) – Whether to self‑sign the token (default:true).
Return value
A promise that resolves to a DailyMeetingTokenResponseReadOutView object containing details of the newly created token.
Usage example
import { dailyAdapter } from 'epicenter-libs';
const token = await dailyAdapter.createToken('my-room-name');
Retrieve
Get Daily configuration
The getConfig() function retrieves the Daily configuration for the Epicenter account and sets up the storage bucket for the meeting recording.
Requires System‑level authentication.
Permissions
Requires a role of SYSTEM.
Function description
- Constructs a
GETrequest to the/daily/v1endpoint. - Accepts optional routing overrides through
RoutingOptions. - Returns the Daily configuration object for the account.
export async function getConfig(
optionals: RoutingOptions = {},
): Promise<unknown>
Parameters
optionals(Type:RoutingOptions, optional) – Additional routing options to override default network call behavior.
Return value
A promise that resolves to unknown.
Usage example
import { dailyAdapter } from 'epicenter-libs';
const config = await dailyAdapter.getConfig();
Get video by recording ID
To retrieve the most recent video file associated with a specific Daily recording instance, use the getVideoByRecordingId() function.
Permissions
Requires a role of PARTICIPANT or higher.
Function description
- Retrieves the directory listing for a Daily room’s recordings using the
DAILYaffiliate. - Filters the list of files to find the one matching the provided
recordingId. - Sorts available files by timestamp (descending) to ensure the most recent match is selected.
- Returns the direct URL to the
.mp4file if found, ornullif no matching recording exists.
export async function getVideoByRecordingId(
room_name: string,
recordingId: string,
scope: { userKey?: string } & GenericScope,
optionals: RoutingOptions = {},
): Promise<string | null>
Parameters
room_name(string) – Name of the Daily room.recordingId(string) – Recording instance ID to search for.scope({ userKey?: string } & GenericScope) – Scope associated with the roomscopeBoundary– Scope entityscopeKey(string) – Unique identifier for the scopeuserKey?(string) – Optional user key to scope the room to a specific user
optionals(Type:RoutingOptions, optional) – Additional routing options.
Return value
A promise that resolves to a URL string if a matching video exists, or null if no matching recording is found.
Usage example
import { dailyAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';
const videoUrl = await dailyAdapter.getVideoByRecordingId(
'my-room',
'recording_instance_id',
{
scopeBoundary: SCOPE_BOUNDARY.GROUP,
scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',
}
);
Update
Update Daily recording status
To mark a Daily room’s recording status as recorded, preventing automatic deletion within one hour, use the updateRecordingStatus() function.
Permissions
Requires a role of PARTICIPANT or higher.
Function description
- Constructs a
DELETErequest to the/daily/v1/meetingToken/{ROOM_NAME}endpoint. - Updates the Daily room’s recording status so that associated videos are retained.
- Returns
truewhen the update succeeds.
export async function updateRecordingStatus(
room_name: string,
optionals: RoutingOptions = {},
): Promise<boolean>
Parameters
room_name(string) – Name of the room whose recording status should be updated.optionals(Type:RoutingOptions, optional) – Additional routing options.
Return value
A promise that resolves to true if the recording status update is successful.
Usage example
import { dailyAdapter } from 'epicenter-libs';
const success = await dailyAdapter.updateRecordingStatus('my-room');