I have wired it via a switch so it comes on when ignition is on but can be turned off at night when main lights are in use to avoid dazzle.
The light I used has a capacitor that stores current to keep the light on after current is turned off, it stays on for a minute or two after engine is switched off, ideal when putting the bike away in the dark. Just needed a piece of tape over light sensor on rear of lamp that turns light off in daylight. The lights will work on 6 volt AC or DC and take very little current, so could be connected to the direct lighting coils on a trials bike without lights or to battery on a roadster
Similar lights are available on eBay new but a bit expensive from £25 upwards https://www.ebay.co.uk/itm/AXA-Blueline-30-Auto-Steady-Front-Cycle-Cycling-Bike-Dynamo-Light/292227115077?epid=1144693156&hash=item440a17e8