Daily.co Integration for Video Calls on Website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Daily.co Integration for Video Calls on Website

Daily.co provides WebRTC infrastructure with a simple JavaScript SDK. You create a room via REST API, send the URL to the user—they open a video call directly in the browser without installing an app. Suitable for video consultations, support chats, training.

Creating a Room via REST API

const DAILY_API_KEY = process.env.DAILY_API_KEY;

async function createRoom(options: {
  name?: string;
  expiresInMinutes?: number;
  maxParticipants?: number;
}): Promise<{ url: string; name: string }> {
  const response = await fetch('https://api.daily.co/v1/rooms', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${DAILY_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: options.name ?? `room-${Date.now()}`,
      properties: {
        exp: Math.floor(Date.now() / 1000) + (options.expiresInMinutes ?? 60) * 60,
        max_participants: options.maxParticipants ?? 10,
        enable_screenshare: true,
        enable_chat: true,
        enable_recording: false,
        start_video_off: false,
        start_audio_off: false,
      },
    }),
  });

  const room = await response.json();
  return { url: room.url, name: room.name };
}

// API for session creation
app.post('/api/video/room', authenticate, async (req, res) => {
  const { consultationId } = req.body;
  const room = await createRoom({
    name: `consultation-${consultationId}`,
    expiresInMinutes: 90,
    maxParticipants: 2,
  });

  await db.consultations.update(consultationId, { roomUrl: room.url });
  res.json({ url: room.url });
});

Participant Token

For private rooms, you need a meeting token—otherwise anyone with the URL can join:

async function createMeetingToken(roomName: string, participantName: string, isOwner = false) {
  const response = await fetch('https://api.daily.co/v1/meeting-tokens', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${DAILY_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      properties: {
        room_name: roomName,
        user_name: participantName,
        is_owner: isOwner,  // owner can remove other participants
        exp: Math.floor(Date.now() / 1000) + 90 * 60,
        enable_recording: isOwner,
      },
    }),
  });

  const { token } = await response.json();
  return token;
}

React Component with Daily JS SDK

npm install @daily-co/daily-js
import DailyIframe from '@daily-co/daily-js';
import { useEffect, useRef, useState } from 'react';

interface VideoCallProps {
  roomUrl: string;
  token: string;
  userName: string;
  onLeave?: () => void;
}

function VideoCall({ roomUrl, token, userName, onLeave }: VideoCallProps) {
  const callRef = useRef<ReturnType<typeof DailyIframe.createFrame> | null>(null);
  const containerRef = useRef<HTMLDivElement>(null);
  const [status, setStatus] = useState<'idle' | 'joining' | 'joined' | 'left'>('idle');

  useEffect(() => {
    if (!containerRef.current) return;

    const call = DailyIframe.createFrame(containerRef.current, {
      showLeaveButton: true,
      showFullscreenButton: true,
      iframeStyle: { width: '100%', height: '100%', border: 'none', borderRadius: '12px' },
    });

    callRef.current = call;

    call.on('joining-meeting', () => setStatus('joining'));
    call.on('joined-meeting', () => setStatus('joined'));
    call.on('left-meeting', () => {
      setStatus('left');
      onLeave?.();
    });
    call.on('error', (err) => console.error('Daily error:', err));

    call.join({ url: roomUrl, token, userName });

    return () => {
      call.destroy();
    };
  }, [roomUrl, token]);

  return (
    <div className="relative" style={{ height: 600 }}>
      {status === 'joining' && (
        <div className="absolute inset-0 flex items-center justify-center bg-gray-900 rounded-xl z-10">
          <p className="text-white">Connecting...</p>
        </div>
      )}
      {status === 'left' && (
        <div className="absolute inset-0 flex items-center justify-center bg-gray-900 rounded-xl z-10">
          <p className="text-white text-lg">Call ended</p>
        </div>
      )}
      <div ref={containerRef} className="w-full h-full" />
    </div>
  );
}

Webhooks for Events

Daily.co sends events to your server:

app.post('/api/webhooks/daily', async (req, res) => {
  const { event_type, payload } = req.body;

  switch (event_type) {
    case 'meeting.started':
      await db.videoSessions.markStarted(payload.room.name);
      break;
    case 'meeting.ended':
      await db.videoSessions.markEnded(payload.room.name, {
        duration: payload.meeting_duration,
      });
      break;
    case 'participant.joined':
      await db.videoSessions.addParticipant(payload.room.name, payload.participant.user_name);
      break;
  }

  res.status(200).end();
});

Timeline

Basic Daily.co integration with room creation and iframe—1–2 days. With tokens, webhooks, and recording—3–4 days.