Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Reference for plugin packaging (
package.jsonopenclaw.plugin.jsonYour
package.jsonopenclawopenclawopenclaw.channelopenclaw.channel| Field | Type | What it means |
|---|---|---|
text id | text string | Canonical channel id. |
text label | text string | Primary channel label. |
text selectionLabel | text string | Picker/setup label when it should differ from text label |
text detailLabel | text string | Secondary detail label for richer channel catalogs and status surfaces. |
text docsPath | text string | Docs path for setup and selection links. |
text docsLabel | text string | Override label used for docs links when it should differ from the channel id. |
text blurb | text string | Short onboarding/catalog description. |
text order | text number | Sort order in channel catalogs. |
text aliases | text string[] | Extra lookup aliases for channel selection. |
text preferOver | text string[] | Lower-priority plugin/channel ids this channel should outrank. |
text systemImage | text string | Optional icon/system-image name for channel UI catalogs. |
text selectionDocsPrefix | text string | Prefix text before docs links in selection surfaces. |
text selectionDocsOmitLabel | text boolean | Show the docs path directly instead of a labeled docs link in selection copy. |
text selectionExtras | text string[] | Extra short strings appended in selection copy. |
text markdownCapable | text boolean | Marks the channel as markdown-capable for outbound formatting decisions. |
text exposure | text object | Channel visibility controls for setup, configured lists, and docs surfaces. |
text quickstartAllowFrom | text boolean | Opt this channel into the standard quickstart text allowFrom |
text forceAccountBinding | text boolean | Require explicit account binding even when only one account exists. |
text preferSessionLookupForAnnounceTarget | text boolean | Prefer session lookup when resolving announce targets for this channel. |
Example:
json{ "openclaw": { "channel": { "id": "my-channel", "label": "My Channel", "selectionLabel": "My Channel (self-hosted)", "detailLabel": "My Channel Bot", "docsPath": "/channels/my-channel", "docsLabel": "my-channel", "blurb": "Webhook-based self-hosted chat integration.", "order": 80, "aliases": ["mc"], "preferOver": ["my-channel-legacy"], "selectionDocsPrefix": "Guide:", "selectionExtras": ["Markdown"], "markdownCapable": true, "exposure": { "configured": true, "setup": true, "docs": true }, "quickstartAllowFrom": true } } }
exposureconfiguredsetupdocsopenclaw.installopenclaw.install| Field | Type | What it means |
|---|---|---|
text npmSpec | text string | Canonical npm spec for install/update flows. |
text localPath | text string | Local development or bundled install path. |
text defaultChoice | text "npm"text "local" | Preferred install source when both are available. |
text minHostVersion | text string | Minimum supported OpenClaw version in the form text >=x.y.z |
text expectedIntegrity | text string | Expected npm dist integrity string, usually text sha512-... |
text allowInvalidConfigRecovery | text boolean | Lets bundled-plugin reinstall flows recover from specific stale-config failures. |
Channel plugins can opt into deferred loading with:
json{ "openclaw": { "extensions": ["./index.ts"], "setupEntry": "./setup-entry.ts", "startup": { "deferConfiguredChannelFullLoadUntilAfterListen": true } } }
When enabled, OpenClaw loads only
setupEntryIf your setup/full entry registers gateway RPC methods, keep them on a plugin-specific prefix. Reserved core admin namespaces (
config.*exec.approvals.*wizard.*update.*operator.adminEvery native plugin must ship an
openclaw.plugin.jsonjson{ "id": "my-plugin", "name": "My Plugin", "description": "Adds My Plugin capabilities to OpenClaw", "configSchema": { "type": "object", "additionalProperties": false, "properties": { "webhookSecret": { "type": "string", "description": "Webhook verification secret" } } } }
For channel plugins, add
kindchannelsjson{ "id": "my-channel", "kind": "channel", "channels": ["my-channel"], "configSchema": { "type": "object", "additionalProperties": false, "properties": {} } }
Even plugins with no config must ship a schema. An empty schema is valid:
json{ "id": "my-plugin", "configSchema": { "type": "object", "additionalProperties": false } }
See Plugin manifest for the full schema reference.
For plugin packages, use the package-specific ClawHub command:
bashclawhub package publish your-org/your-plugin --dry-run clawhub package publish your-org/your-plugin
The
setup-entry.tsindex.tstypescript// setup-entry.ts import { defineSetupPluginEntry } from "openclaw/plugin-sdk/channel-core"; import { myChannelPlugin } from "./src/channel.js"; export default defineSetupPluginEntry(myChannelPlugin);
This avoids loading heavy runtime code (crypto libraries, CLI registrations, background services) during setup flows.
Bundled workspace channels that keep setup-safe exports in sidecar modules can use
defineBundledChannelSetupEntry(...)openclaw/plugin-sdk/channel-entry-contractdefineSetupPluginEntry(...)runtimeFor hot setup-only paths, prefer the narrow setup helper seams over the broader
plugin-sdk/setup| Import path | Use it for | Key exports |
|---|---|---|
text plugin-sdk/setup-runtime | setup-time runtime helpers that stay available in text setupEntry | text createPatchedAccountSetupAdaptertext createEnvPatchedAccountSetupAdaptertext createSetupInputPresenceValidatortext noteChannelLookupFailuretext noteChannelLookupSummarytext promptResolvedAllowFromtext splitSetupEntriestext createAllowlistSetupWizardProxytext createDelegatedSetupWizardProxy |
text plugin-sdk/setup-adapter-runtime | environment-aware account setup adapters | text createEnvPatchedAccountSetupAdapter |
text plugin-sdk/setup-tools | setup/install CLI/archive/docs helpers | text formatCliCommandtext detectBinarytext extractArchivetext resolveBrewExecutabletext formatDocsLinktext CONFIG_DIR |
Use the broader
plugin-sdk/setupmoveSingleAccountChannelSectionToDefaultAccount(...)The setup patch adapters stay hot-path safe on import. Their bundled single-account promotion contract-surface lookup is lazy, so importing
plugin-sdk/setup-runtimeWhen a channel upgrades from a single-account top-level config to
channels.<id>.accounts.*accounts.defaultBundled channels can narrow or override that promotion through their setup contract surface:
singleAccountKeysToMovenamedAccountPromotionKeysresolveSingleAccountPromotionTarget(...)Plugin config is validated against the JSON Schema in your manifest. Users configure plugins via:
json5{ plugins: { entries: { "my-plugin": { config: { webhookSecret: "abc123", }, }, }, }, }
Your plugin receives this config as
api.pluginConfigFor channel-specific config, use the channel config section instead:
json5{ channels: { "my-channel": { token: "bot-token", allowFrom: ["user1", "user2"], }, }, }
Use
buildChannelConfigSchemaChannelConfigSchematypescriptimport { z } from "zod"; import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema"; const accountSchema = z.object({ token: z.string().optional(), allowFrom: z.array(z.string()).optional(), accounts: z.object({}).catchall(z.any()).optional(), defaultAccount: z.string().optional(), }); const configSchema = buildChannelConfigSchema(accountSchema);
For third-party plugins, the cold-path contract is still the plugin manifest: mirror the generated JSON Schema into
openclaw.plugin.json#channelConfigschannels.<id>Channel plugins can provide interactive setup wizards for
openclaw onboardChannelSetupWizardChannelPlugintypescriptimport type { ChannelSetupWizard } from "openclaw/plugin-sdk/channel-setup"; const setupWizard: ChannelSetupWizard = { channel: "my-channel", status: { configuredLabel: "Connected", unconfiguredLabel: "Not configured", resolveConfigured: ({ cfg }) => Boolean((cfg.channels as any)?.["my-channel"]?.token), }, credentials: [ { inputKey: "token", providerHint: "my-channel", credentialLabel: "Bot token", preferredEnvVar: "MY_CHANNEL_BOT_TOKEN", envPrompt: "Use MY_CHANNEL_BOT_TOKEN from environment?", keepPrompt: "Keep current token?", inputPrompt: "Enter your bot token:", inspect: ({ cfg, accountId }) => { const token = (cfg.channels as any)?.["my-channel"]?.token; return { accountConfigured: Boolean(token), hasConfiguredValue: Boolean(token), }; }, }, ], };
The
ChannelSetupWizardcredentialstextInputsdmPolicyallowFromgroupAccesspreparefinalizesrc/channel.setup.tsExternal plugins: publish to ClawHub, then install:
textOpenClaw tries ClawHub first and falls back to npm automatically.
text```bash} openclaw plugins install npm:@myorg/openclaw-my-plugin ```
In-repo plugins: place under the bundled plugin workspace tree and they are automatically discovered during build.
Users can install:
bashopenclaw plugins install <package-name>
Bundled package-level runtime deps are explicit metadata, not inferred from built JavaScript at gateway startup. If a shared OpenClaw root dependency must be available inside the external bundled-plugin runtime mirror, declare it in
openclaw.bundle.mirroredRootRuntimeDependenciesdefinePluginEntrydefineChannelPluginEntry© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine