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
| Field | Contract |
|---|---|
id | Identifier used as the generated client key. Starts with a letter, followed by letters, digits, or underscores. |
bridge | Native bridge name, with the same identifier rules. |
dependencies | Record of npm package names to nonempty version requirements. Required, including when empty. |
commands | Record of command identifiers to { args, result, errors }. |
config | Optional { selector, schema }. Reads pluginOptions[selector]. |
android | Optional { className, sources, dependencies }. |
ios | Optional { 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
| Field | Contract |
|---|---|
| Source entry | { file, source }: destination filename and source path relative to manifest module |
Android className | May be a qualified Java name |
| Android dependencies | Gradle group:artifact to version requirements |
iOS className | Identifier |
| iOS dependencies | { url, version, product }; HTTPS URL; product identifier |
| Enabled output | Sources, 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 failure | Meaning |
|---|---|
InvalidPlugin | Invalid manifest or plugin dependency |
PluginDependencyConflict | Incompatible enabled dependency requirements |
InvalidConfig | Invalid generated contributions or configuration |
Disabled plugins contribute no native sources or configuration.
Source: manifest implementation.