# 🚀 IC Reactor v4: A New Way to Generate Typed Canister Calls From Your .did

**URL:** <https://forum.dfinity.org/t/ic-reactor-v4-a-new-way-to-generate-typed-canister-calls-from-your-did/76311>\
**Category:** internet-identity\
**Tags:** Functional-Programming, candid, ic-reactor\
**Created:** [November 2, 2026, 3:04pm UTC](https://forum.dfinity.org/t/ic-reactor-v4-a-new-way-to-generate-typed-canister-calls-from-your-did/76311 "2026-11-02T15:04:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![b3hr4d](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/b3hr4d/32/9755_2.png) [@b3hr4d](https://forum.dfinity.org/u/b3hr4d)\
**Post date:** [November 2, 2026, 3:04pm UTC](https://forum.dfinity.org/t/ic-reactor-v4-a-new-way-to-generate-typed-canister-calls-from-your-did/76311/1 "2026-11-02T15:04:02Z")

</div>

ic-reactor 4 is out: typed calls to Internet Computer canisters from TypeScript and React, built on TanStack Query. Generate a module from a canister’s `.did` file, then call it:

```ts
import { createClient } from "@ic-reactor/core"
import { actor, type Actor } from "./generated/icrc1" // from icrc1.did

const client = createClient({ network: "ic", identity: "anonymous" })
const ledger = client.canister<Actor>(actor, {
  id: "ryjl3-tyaaa-aaaaa-aaaba-cai", // the ICP ledger
})

console.log(await ledger.icrc1_fee()) // 10000n

```

- Reads cached per caller, and cleared on sign-out
- One error type that says whether a failed call may have run
- Internet Identity 2.0 sign-in, including one-click Google, Apple and Microsoft
- React hooks, a Vite plugin, a test client and exact token units

The module comes from [Meant](https://b3pay.net/docs/meant/). It also compiles the `.did` into a canonical JSON contract, with its own identity and room for extensions, so tools can build on the exact interface safely, without parsing Candid themselves. Much more is coming on top of it, like profiles that say what each value means and what each call does, for AI agent tools and consent messages. More on that soon in its own thread…

[Get started](https://b3pay.net/docs/ic-reactor/guides/getting-started/) · [Examples](https://b3pay.net/docs/ic-reactor/examples/) · [GitHub](https://github.com/B3Pay/ic-reactor)

Coming from 3.x? See [Migrating from 3.x](https://b3pay.net/docs/ic-reactor/migrating-from-3/).

---

<div class="post-metadata">

**Author:** ![b3hr4d](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/b3hr4d/32/9755_2.png) [@b3hr4d](https://forum.dfinity.org/u/b3hr4d)\
**Post date:** [November 11, 2026, 10:38am UTC](https://forum.dfinity.org/t/ic-reactor-v4-a-new-way-to-generate-typed-canister-calls-from-your-did/76311/2 "2026-11-11T10:38:10Z")

</div>

ic-reactor 4.3.0 is out, ready for Internet Identity’s [revocable sessions](https://forum.dfinity.org/t/revocable-internet-identity-sessions-upgrade-to-icp-sdk-auth-v11/76447).

```tsx
import { createClient } from "@ic-reactor/core"
import { ReactorProvider, useAuth } from "@ic-reactor/react"
import { AuthClient } from "@icp-sdk/auth/client"

export const App = () => (
  <ReactorProvider
    client={() => createClient({ network: "ic", auth: (network) => new AuthClient(network) })}
  >
    <Account />
  </ReactorProvider>
)

// Re-renders when another tab signs in or out, or the session ends
function Account() {
  const { status, principal, signIn, signOut } = useAuth()
  if (status === "signed-in") {
    return <button onClick={() => signOut().catch(console.error)}>Sign out {principal}</button>
  }
  return (
    <>
      {status === "expired" && <p>Your session ended.</p>}
      <button onClick={() => signIn().catch(console.error)}>Sign in</button>
    </>
  )
}

```

- When a session ends (a sign-out in any tab, an idle timeout, or a device signed out in II’s settings), the client drops that user’s agent and cached reads, and `useAuth()` re-renders with the new status. A call that needed the ended session is refused before it is sent, so it’s safe to retry after signing in.
- The Vite plugin now requires a Vite with the CVE-2025-24010 fix (4.5.6, 5.4.12, 6.0.9, or 7 and later).
- `client.time()` refuses an IC time more than five minutes older than one it has already read.

`npm install @ic-reactor/core@4.3.0 @ic-reactor/react@4.3.0 @icp-sdk/auth@^11`

[Sessions that end early](https://b3pay.net/docs/ic-reactor/guides/auth/#sessions-that-end-early) · [Changelog](https://github.com/B3Pay/ic-reactor/blob/main/CHANGELOG.md)
