Installation
@foresightjs/react is the official React package for ForesightJS. It gives you useForesight, useForesights and useForesightEvent so you can register elements and read their prediction state straight from a component.
npm install @foresightjs/react
# or
pnpm add @foresightjs/react
# or
yarn add @foresightjs/react
That's it. Everything you need, including ForesightManager and all types, comes from @foresightjs/react — there's nothing else to install:
import { useForesight, ForesightManager } from "@foresightjs/react"
Configuring the manager
You don't have to configure anything. The manager auto-initializes with sensible defaults the first time you register an element.
If you do want to tweak global behaviour, call ForesightManager.initialize() once at your app entry point. See Initialize the Manager and Global Settings.
Devtools
The visual Development Tools live in their own package (js.foresight-devtools) and work the same regardless of framework.