Radical
Reference

Plugin manifest API

Schema-defined native commands and generation metadata.

@akshatowo/radical/plugins exports definePlugin, PluginManifestSchema, CommandSchema, callPlugin, createPluginClient, and the PluginManifest and PluginClient types.

definePlugin(manifest) preserves concrete schema types. Validation occurs before generation. createPluginClient(manifest) creates typed command functions. callPlugin(plugin, method, command, args) encodes arguments, calls the bridge, and decodes the result. Both client forms return Effects requiring Bridge.

Manifest fields

FieldContract
idIdentifier used as the generated client key. Starts with a letter, followed by letters, digits, or underscores.
bridgeNative bridge name, with the same identifier rules.
dependenciesRecord of npm package names to nonempty version requirements. Required, including when empty.
commandsRecord of command identifiers to { args, result, errors }.
configOptional { selector, schema }. Reads pluginOptions[selector].
androidOptional { className, sources, dependencies }.
iosOptional { className, sources, dependencies }.

Each command's args and result are Effect Schema codecs. errors maps native rejection codes to codecs for tagged errors. Arguments must encode to an object accepted by the bridge.

Native error mapping decodes { ...cause.data, _tag: cause.code }. An undeclared code, non-object data, or failed error decode remains BridgeCallFailed. Invalid arguments and results produce BridgeDecodeError.

Native metadata

FieldContract
Source entry{ file, source }: destination filename and source path relative to manifest module
Android classNameMay be a qualified Java name
Android dependenciesGradle group:artifact to version requirements
iOS classNameIdentifier
iOS dependencies{ url, version, product }; HTTPS URL; product identifier
Enabled outputSources, registration, npm requirements, Gradle dependencies, SPM products
Config plugins entry{ manifest, selector? }; selector chooses named export, omitted selects default

Internal manifest exports

@akshatowo/radical/internal-plugins exports devicePlugin, transitionsPlugin, cameraPlugin, filePickerPlugin, appLauncherPlugin, fileOpenerPlugin, videoStreamPlugin, hapticsPlugin, networkPlugin, googleSignInPlugin, dataProtectionPlugin, localNotificationsPlugin, firebaseMessagingPlugin, badgePlugin, and notificationTopicsPlugin.

These use the same manifest contract as custom plugins. The internal registry owns defaults and capability implications.

Generation failureMeaning
InvalidPluginInvalid manifest or plugin dependency
PluginDependencyConflictIncompatible enabled dependency requirements
InvalidConfigInvalid generated contributions or configuration

Disabled plugins contribute no native sources or configuration.

Source: manifest implementation.

On this page