INTEGRITY Documentation

Meeting Metadata

All metadata pertaining to a meeting is stored in meeting.meta. This includes important information about the meeting state, type, and connections.

Available metadata

Select a framework based on the platform you are building for.

The meeting.meta object contains the following properties:

The meeting.meta object contains the following properties:

The meeting.meta object contains the following properties:

The meeting.meta object contains the following properties:

The meeting.meta object contains the following properties:

Access meeting metadata

To access meeting metadata, use the meeting.meta object.

// Destructure the metadata to get meetingTitle
const { meetingTitle } = meeting.meta;

if (meeting.self.roomJoined) {
	console.log(
		`The local user has joined a meeting with title ${meetingTitle}.`,
	);
}
import { useRealtimeKitSelector } from "@cloudflare/realtimekit-react";
import { useEffect } from "react";

function MeetingInfo() {
	const [meetingTitle, roomJoined] = useRealtimeKitSelector((m) => [
		m.meta.meetingTitle,
		m.self.roomJoined,
	]);

	useEffect(() => {
		if (roomJoined) {
			console.log(
				`The local user has joined a meeting with title ${meetingTitle}.`,
			);
		}
	}, [roomJoined, meetingTitle]);

	return null;
}
val meetingTitle = meeting.meta.meetingTitle
let meetingTitle = meeting.meta.meetingTitle
import { useRealtimeKitSelector } from "@cloudflare/realtimekit-react-native";
import { useEffect } from "react";

const [meetingTitle, roomJoined] = useRealtimeKitSelector((m) => [
	m.meta.meetingTitle,
	m.self.roomJoined,
]);

useEffect(() => {
	if (roomJoined) {
		console.log(
			`The local user has joined a meeting with title ${meetingTitle}.`,
		);
	}
}, [roomJoined, meetingTitle]);

Connection events

The meta object also emits events for indicating changes in the connection state of the meeting.

Media connection updates

Updates to the media connection (WebRTC connection used for the transfer of actual media) are sent via the mediaConnectionUpdate event.

meeting.meta.on("mediaConnectionUpdate", ({ transport, state }) => {
	// transport - 'consuming' | 'producing'
	// state - 'new' | 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'failed'

	console.log(`Media connection ${transport} is now ${state}`);
});

The mediaConnectionUpdate event provides:

Updates to the media connection (WebRTC connection used for the transfer of actual media) are sent via the mediaConnectionUpdate event.

import { useRealtimeKitClient } from "@cloudflare/realtimekit-react";
import { useEffect } from "react";

function MediaConnectionMonitor() {
	const [meeting] = useRealtimeKitClient();

	useEffect(() => {
		if (meeting) {
			const handleMediaConnection = ({ transport, state }) => {
				// transport - 'consuming' | 'producing'
				// state - 'new' | 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'failed'

				console.log(`Media connection ${transport} is now ${state}`);
			};

			meeting.meta.on("mediaConnectionUpdate", handleMediaConnection);

			return () => {
				meeting.meta.off("mediaConnectionUpdate", handleMediaConnection);
			};
		}
	}, [meeting]);

	return null;
}

The mediaConnectionUpdate event provides:

You can access the current media connection state directly from the metadata.

val mediaConnectionState = meeting.meta.mediaConnectionState

You can access the current media connection state directly from the metadata.

let mediaConnectionState = meeting.meta.mediaConnectionState

Updates to the media connection (WebRTC connection used for the transfer of actual media) are sent via the mediaConnectionUpdate event.

meeting.meta.on("mediaConnectionUpdate", ({ transport, state }) => {
	// transport - 'consuming' | 'producing'
	// state - 'new' | 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'failed'

	console.log(`Media connection ${transport} is now ${state}`);
});

The mediaConnectionUpdate event provides:

Socket connection updates

Updates to the WebSocket connection (used for chat, polls, and other basic signaling) are sent via the socketConnectionUpdate event.

meeting.meta.on(
	"socketConnectionUpdate",
	({ state, reconnectionAttempt, reconnected }) => {
		// state - 'connected' | 'disconnected' | 'reconnecting' | 'failed'

		console.log(`Socket connection is now ${state}`);

		if (reconnectionAttempt) {
			console.log(`Reconnection attempt: ${reconnectionAttempt}`);
		}

		if (reconnected) {
			console.log("Successfully reconnected");
		}
	},
);

The socketConnectionUpdate event provides:

Updates to the WebSocket connection (used for chat, polls, and other basic signaling) are sent via the socketConnectionUpdate event.

import { useRealtimeKitClient } from "@cloudflare/realtimekit-react";
import { useEffect } from "react";

function SocketConnectionMonitor() {
	const [meeting] = useRealtimeKitClient();

	useEffect(() => {
		if (meeting) {
			const handleSocketConnection = ({
				state,
				reconnectionAttempt,
				reconnected,
			}) => {
				// state - 'connected' | 'disconnected' | 'reconnecting' | 'failed'

				console.log(`Socket connection is now ${state}`);

				if (reconnectionAttempt) {
					console.log(`Reconnection attempt: ${reconnectionAttempt}`);
				}

				if (reconnected) {
					console.log("Successfully reconnected");
				}
			};

			meeting.meta.on("socketConnectionUpdate", handleSocketConnection);

			return () => {
				meeting.meta.off("socketConnectionUpdate", handleSocketConnection);
			};
		}
	}, [meeting]);

	return null;
}

The socketConnectionUpdate event provides:

You can access the current socket connection state directly from the metadata.

val socketConnectionState = meeting.meta.socketConnectionState

You can access the current socket connection state directly from the metadata.

let socketConnectionState = meeting.meta.socketConnectionState

Updates to the WebSocket connection (used for chat, polls, and other basic signaling) are sent via the socketConnectionUpdate event.

meeting.meta.on(
	"socketConnectionUpdate",
	({ state, reconnectionAttempt, reconnected }) => {
		// state - 'connected' | 'disconnected' | 'reconnecting' | 'failed'

		console.log(`Socket connection is now ${state}`);

		if (reconnectionAttempt) {
			console.log(`Reconnection attempt: ${reconnectionAttempt}`);
		}

		if (reconnected) {
			console.log("Successfully reconnected");
		}
	},
);

The socketConnectionUpdate event provides:

Next steps

Explore related topics: