sitemap.xml llms.txt
Skip to main content

Daily Functions

The functions of the Daily adapter handle interactions with the Daily video conferencing service.

Importing the adapter

To use the functions of the Daily adapter, import it as shown:
import { dailyAdapter } from 'epicenter-libs';

The dailyAdapter namespace exports functions that make calls to the Daily API.

learn more

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 POST request to the /daily/v1/room endpoint.
  • 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.
Function signature
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 room
    • scopeBoundary – Scope entity
    • scopeKey (string) – Unique identifier for the scope
    • userKey? (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 permit
    • writeLock? (keyof typeof ROLE) – Write lock part of the permit
    • ttlSeconds? (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 limits
    • streaming_endpoints? (Array) – Streaming configuration
      • name (string) – Stream name
      • type (StreamType) – Stream type (currently only 'HLS')
      • hls_config – HLS configuration
        • storage.path (string) – S3 storage path
        • storage.bucket_region? (string) – S3 bucket region
        • storage.assume_role_arn? (string) – IAM role ARN for S3 access
        • storage.bucket_name? (string) – S3 bucket name
        • save_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 POST request to the /daily/v1/meetingToken endpoint.
  • 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.
Function signature
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.

Important

Requires System‑level authentication.

Permissions

Requires a role of SYSTEM.

Function description

  • Constructs a GET request to the /daily/v1 endpoint.
  • Accepts optional routing overrides through RoutingOptions.
  • Returns the Daily configuration object for the account.
Function signature
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 DAILY affiliate.
  • 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 .mp4 file if found, or null if no matching recording exists.
Function signature
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 room
    • scopeBoundary – Scope entity
    • scopeKey (string) – Unique identifier for the scope
    • userKey? (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 DELETE request to the /daily/v1/meetingToken/{ROOM_NAME} endpoint.
  • Updates the Daily room’s recording status so that associated videos are retained.
  • Returns true when the update succeeds.
Function signature
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');