# `PhoenixKit.Install.RouterIntegration`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit/install/router_integration.ex#L1)

Handles router integration for PhoenixKit installation.

This module provides functionality to:
- Find and validate Phoenix router modules
- Add PhoenixKit imports and routes to routers
- Generate demo page routes
- Handle router integration warnings and notices

# `add_router_integration`

Adds PhoenixKit integration to the Phoenix router.

## Parameters
- `igniter` - The igniter context
- `custom_router_path` - Custom path to router file (optional)

## Returns
Updated igniter with router integration or warnings if router not found.

# `verify_and_fix_router_position`

Verifies and fixes the position of phoenix_kit_routes() in the router.

During updates, checks if phoenix_kit_routes() is positioned AFTER catch-all routes
(/:param or /*path patterns) and automatically moves it BEFORE them.

## Parameters
- `igniter` - The igniter context
- `custom_router_path` - Custom path to router file (optional)

## Returns
Updated igniter with router position fixed or unchanged if already correct.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
