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").
npm i @respiresoft/meet-embedimport { 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.
- Your page's origin must be in the project's
embed_origins, or the browser refuses the frame (you get atimeoutoncall.ready). embed(target, options)options:url,token,key,theme,lang,hide,width,height,name,autoJoin,readyTimeout(30 s),commandTimeout(10 s).- Commands return promises:
join,leave,setAudio,setVideo,startScreenShare,stopScreenShare,setTheme,setCaptions,setLanguage,sendChat. They wait forreadyand reject with aMeetEmbedError(code:timeout,destroyed,not_in_call, ...). - Events:
call.on(name, fn),off,once:ready,joined,left,participant-joined,participant-left,participant-updated,active-speaker,chat-message,caption,error. - 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.