How-to guides
Add a typed native plugin
Enable a Schema-defined manifest and call its commands.
Define the manifest
Copy the Echo manifest, following the manifest contract.
Enable the plugin
Configure your manifest:
plugins: [{ manifest: "./plugins/echo.ts" }],
pluginOptions: { Echo: { prefix: "Native: " } },Generate declarations
Include .radical/plugins.d.ts in tsconfig.json before running:
pnpm exec radical typegenRegenerate shells after manifest or native-source changes.
Call the command
Run this Effect from your lifecycle or event handler:
import { Effect } from "effect";
import { BridgeLive } from "@akshatowo/radical/client";
import { plugins } from "virtual:radical/plugins";
const echo = plugins.echo.echo({ text: "hello" }).pipe(
Effect.catchTag("EchoRejected", (error) =>
Effect.succeed({ text: error.reason })
),
Effect.provide(BridgeLive)
);You receive the native Echo result or handled rejection.
See the bridge sequence.