Meet API Docs Dashboard
On this page

Embed SDK for Meet Calls

@respiresoft/meet-embed, about 2 kB gzipped, no dependencies.

Start with the embed quick start. The messages behind the SDK are on Embed protocol.

Reference from the package README#

Put a Meet meeting on any page. Zero dependencies, about 2 kB gzipped. The protocol and the origin allow-list are in docs/PLATFORM.md ("Embed").

sh
npm i @respiresoft/meet-embed
js
import { embed } from '@respiresoft/meet-embed';

const call = embed('#meeting', {
  url: 'https://meet.respiresoft.com/r/<slug>',
  token,                    // minted by your server, never a secret key
  theme: 'dark', lang: 'en', hide: ['chat'],
});
call.on('joined', ({ participantId, role }) => {});
await call.setAudio(false);
await call.leave();
call.destroy();

With a <script> tag use dist/meet-embed.umd.cjs; it defines Meet.embed.

  1. Your page's origin must be in the project's embed_origins, or the browser refuses the frame (you get a timeout on call.ready).
  2. embed(target, options) options: url, token, key, theme, lang, hide, width, height, name, autoJoin, readyTimeout (30 s), commandTimeout (10 s).
  3. Commands return promises: join, leave, setAudio, setVideo, startScreenShare, stopScreenShare, setTheme, setCaptions, setLanguage, sendChat. They wait for ready and reject with a MeetEmbedError (code: timeout, destroyed, not_in_call, ...).
  4. Events: call.on(name, fn), off, once: ready, joined, left, participant-joined, participant-left, participant-updated, active-speaker, chat-message, caption, error.
  5. The iframe gets allow="camera; microphone; display-capture; autoplay; fullscreen; clipboard-write; speaker-selection". If you build the iframe yourself, set the same.

Messages from any other window or origin are ignored. Develop: pnpm --filter @respiresoft/meet-embed test, ... build, node test/e2e.mjs.