# Initialize the Manager

Optional Step

This step is **not needed** if you don't want to configure ForesightJS. The manager will initialize automatically with default settings the first time a directive, component, or service registration runs.

If you don't want to configure anything, skip to [Quick Start](/docs/angular/quick-start.md).

If you want to customize ForesightJS's global behavior, call `ForesightManager.initialize()` once at your application's entry point before Angular renders components that register elements:

```
import { ForesightManager } from "@foresightjs/angular"

ForesightManager.initialize({
  defaultHitSlop: 20,
  touchDeviceStrategy: "viewport",
})
```

## Optional Settings[​](#optional-settings "Direct link to Optional Settings")

You can configure any of these [global settings](/docs/angular/configuration/global-settings.md).

```
ForesightManager.initialize({
  // Mouse prediction settings
  enableMousePrediction: true, // Enable/disable mouse trajectory prediction
  trajectoryPredictionTime: 120, // How far ahead to predict (10-200ms)
  positionHistorySize: 8, // Mouse positions to track (2-30)

  // Keyboard prediction settings
  enableTabPrediction: true, // Enable/disable keyboard navigation prediction
  tabOffset: 2, // Tab stops ahead to trigger (0-20)

  // Scroll prediction settings
  enableScrollPrediction: true, // Enable/disable scroll prediction
  scrollMargin: 150, // Pixel distance for scroll detection (30-300)

  // Touch device settings
  touchDeviceStrategy: "viewport", // "none", "viewport", or "onTouchStart"

  // Connection settings
  minimumConnectionType: "3g", // "slow-2g", "2g", "3g", "4g"

  // Default element settings
  defaultHitSlop: 0, // Default hit slop for all elements (number or {top, right, bottom, left})
})
```

## Good to know[​](#good-to-know "Direct link to Good to know")

The `ForesightManager` is a singleton, meaning it can only be initialized once. If you call `ForesightManager.initialize()` multiple times, only the first call will take effect. Any subsequent calls will simply return the already initialized instance.

The manager also provides several static methods you can use to inspect registered elements, callback counts, and [event](/docs/angular/events.md) listeners. You can find a list of these methods [here](/docs/angular/static-properties.md).
