Goal: Scaffold a plugin and make one visible change on a single interceptor target that exists in the SDK. Prerequisite: Getting started completed (includesDocumentation Index
Fetch the complete documentation index at: https://orderly.network/docs/llms.txt
Use this file to discover all available pages before exploring further.
orderly-devkit skills install and mcp install if you use an agent).
Using agent skills for this tutorial
Install the default plugin skills once — see Skills-first workflow. For this tutorial the relevant skills are:| Skill | What it covers | CLI / tool it leads you to |
|---|---|---|
| orderly-plugin-create | Scaffold from the official template; naming (--name, --id), --interceptor, --target. | orderly-devkit create plugin (interactive or --no-interactive + flags). |
| orderly-plugin-write | Interceptor patterns, Hooks in inner components, docs-first API lookup. | Editing generated code; Orderly SDK Docs MCP (orderly_docs_search, orderly_docs_get_component, orderly_docs_get_type — not orderly_docs_get_hook). |
FeeHint with interceptor Trading.OrderEntry.SubmitSection under ./fee-hint” → maps to create. “Add a wrapper around the submit section that shows a small label” → maps to write + your code changes.
You can still run orderly-devkit create plugin by hand; the skill is the structured checklist so the agent does not skip flags or mix up plugin id rules.
1. Pick a target path
Valid runtime targets are listed in Runtime injector targets (paths must match exactly, case-sensitive). For this tutorial, use a target you know appears on your trading page—for exampleTrading.OrderEntry.SubmitSection or another row from that page.
Note: orderly-devkit create plugin --interceptor only offers a subset of SDK targets. You can still register interceptors for any runtime path in Runtime injector targets by editing the generated plugin code.
2. Create the project
--no-interactive with --name, --id, --interceptor, and --target as in Getting started.
3. Implement one small behavior
Open the generated registration file (oftenplugin.tsx or similar—follow the template). Ensure SDK.registerPlugin includes an interceptor whose target equals your chosen path.
Typical pattern (pseudo-code; align with the template’s exports):
component function is not a React component—do not call Hooks directly on it. Return JSX that uses inner components if you need Hooks (see Interceptor strategies).
4. Build the package
package.json.
Verification: Build exits with code 0.
5. Integrate in a host (smoke test)
Follow Tutorial 2: Integrate into host to addplugins={[registerYourPlugin()]} on OrderlyAppProvider.
Verification: Navigate to the trading view and confirm your UI change appears at the interceptor location.
Failure recovery
| Issue | Action |
|---|---|
| Target not found / no effect | Re-read the target against Runtime injector targets; typos break injection. |
| Hooks error in interceptor | Move Hook usage into a child component; see How-to: Interceptor strategies. |
| Scaffold mismatch | Regenerate or trim generated files to the minimal registerPlugin shape; see Plugin types and @orderly.network/plugin-core on npm for full architecture. |