Create a new actor manager with the given options. Its create a new agent manager if not provided. It also creates a new actor manager with the given options.
import { candid, canisterId, idlFactory } from "./declarations/candid"type Candid = typeof candidconst { agentManager, callMethod } = createReactorStore<Candid>({ canisterId, idlFactory,})// Usage exampleawait agentManager.authenticate()const authClient = agentManager.getAuth()authClient?.login({ onSuccess: () => { console.log("Logged in successfully") }, onError: (error) => { console.error("Failed to login:", error) },})// Call a methodconst version = callMethod("version")console.log("Response from version method:", await version) Copy
import { candid, canisterId, idlFactory } from "./declarations/candid"type Candid = typeof candidconst { agentManager, callMethod } = createReactorStore<Candid>({ canisterId, idlFactory,})// Usage exampleawait agentManager.authenticate()const authClient = agentManager.getAuth()authClient?.login({ onSuccess: () => { console.log("Logged in successfully") }, onError: (error) => { console.error("Failed to login:", error) },})// Call a methodconst version = callMethod("version")console.log("Response from version method:", await version)
Create a new actor manager with the given options. Its create a new agent manager if not provided. It also creates a new actor manager with the given options.
Example