Skip to content

@ic-reactor/core

@ic-reactor/core is the framework-agnostic foundation of IC Reactor. It gives you the runtime building blocks for agent management, authentication, TanStack Query integration, and typed canister interaction without depending on React.

  • You need ClientManager, Reactor, or DisplayReactor in non-React code.
  • You want to use IC Reactor in loaders, services, scripts, or framework adapters.
  • You are building your own abstractions on top of IC Reactor’s runtime layer.
Terminal window
pnpm add @ic-reactor/core @icp-sdk/core @tanstack/query-core
# Optional: Internet Identity support
pnpm add @icp-sdk/auth
import { ClientManager, Reactor } from "@ic-reactor/core"
import { QueryClient } from "@tanstack/query-core"
import { idlFactory, type _SERVICE } from "./declarations/backend"
const queryClient = new QueryClient()
const clientManager = new ClientManager({
queryClient,
withProcessEnv: true,
})
await clientManager.initialize()
const backend = new Reactor<_SERVICE>({
clientManager,
idlFactory,
name: "backend",
})
const greeting = await backend.fetchQuery({
functionName: "greet",
args: ["World"],
})