Skip to content

Build your own plugins

This guide explains how to build a custom plugin and run it inside a meeting using the Cloudflare RealtimeKit Core SDK.

A custom plugin is a DOM element that you register with the SDK. When a participant activates the plugin, RealtimeKit makes it active for everyone in the session and renders it in the meeting layout.

This page is not available for the Mobileplatform.

Prerequisites

This page builds on the Initialize SDK and Plugins guides. Read those first.

The examples assume you have already imported the necessary packages and initialized the SDK.

How a plugin works

A plugin has two parts:

  • A component: a DOM element (HTMLElement) that holds your plugin's UI and logic.
  • A registration: a configuration object you pass to the SDK so it can list, activate, and render the component.

RealtimeKit synchronizes activation state across the session. To share plugin data between participants, use collaborative stores.

1. Build the plugin component

A plugin component must be an HTMLElement. Build it directly as a custom element, or create a container element and mount your framework component tree into it.

2. Register and render the plugin

Register the plugins available in a session when you initialize the SDK. Pass an array of plugin configurations as defaults.plugins, using the pluginElement you created in step 1 as the component.

For a description of every configuration field, refer to Register a plugin.

After registration, the plugin appears in meeting.plugins.all. Activate it to make it active for everyone in the session.

3. Respond to plugin events

A Plugin object emits events as its state changes. Use them to set up or tear down your component when it is activated or deactivated.

For the full list of plugin events, refer to Listen to plugin events.

4. Sync data across participants

Each participant runs their own copy of the plugin component, so you need a way to share state between them. RealtimeKit offers two built-in options for real-time communication:

For plugins with simple requirements, these built-in APIs are enough to handle your collaborative logic.

For richer, full-featured collaboration, you can pair your plugin with a dedicated third-party framework:

FrameworkDescriptionNotes
Collab-KitFull-featured SDK for building collaborative apps.Beta
Party-KitLow-level framework for building collaborative applications.Open source

Next steps