@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.
When to Use This Package
Section titled “When to Use This Package”- You need
ClientManager,Reactor, orDisplayReactorin 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.
Installation
Section titled “Installation”pnpm add @ic-reactor/core @icp-sdk/core @tanstack/query-core
# Optional: Internet Identity supportpnpm add @icp-sdk/authWhat’s Included
Section titled “What’s Included” ClientManager Shared agent, authentication, and query-client orchestration.
Reactor Type-safe canister access with cache-friendly query and mutation helpers.
DisplayReactor UI-friendly transformations for bigint, Principal, variants, and optional fields.
Validation Validation helpers for turning canister and input issues into typed UI state.
Quick Start
Section titled “Quick Start”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"],})See Also
Section titled “See Also”- @ic-reactor/react — React bindings built on top of this package
- React Setup — End-to-end React integration guide
- @ic-reactor/candid — Dynamic runtime Candid support