Relatude Help

How a plugin is loaded

The interface's page has an import map for the six modules it shares with plugins: react, react/jsx-runtime, react-dom, react-dom/client, @relatude/sdk and @relatude/ui. A plugin leaves these as bare imports, so it runs on the interface's own React, SDK and components.

After sign-in, the interface loads its built-in plugins, then those named in the page's address (?plugin=, below), then the site's: those its modules bring (chapter 18), then those listed in its CMS settings. Plugins added in this browser come last. Each is loaded with import(url), its definePlugin export is checked against the interface's SDK version, and what it contributes is added.

A plugin that fails to load is marked as failed, and the interface goes on without it. Every blade has an error boundary: a component that throws shows the error in its blade, with Try again, and the rest of the interface keeps working. ?safemode=1 opens the interface with its built-in plugins only.