Regardless of the application, LEDs need a current limiting resistor in series with them. That's because LEDs are diodes, and a diode will attempt to pass almost infinite current if you put anything but a very small voltage across it.
But with the resistor in series, as the current increases, more and more voltage is dropped across the resistor instead of the LED until a kind of equilibrium is reached. Adjusting the value of the resistor or voltage adjusts the current and thus the brightness.
The LED manufacturer specifies a maximum current, so you just need to pick a resistor that won't allow the current to exceed that maximum.