32u4: Disable HID Device Class at Runtime

I am creating an USB-Stick that can be configured through a WebApp (using the WebUSB API). After configuration it should enter some Keys as a Keyboard. (after unplugging/plugging). The next time I plug it, it is not a Keyboard and I can configure it again.

Since the WebUSB API blocks HID Devices, it must not report itself as a HID Device when I want to configure it.

Is there a way to include Keyboard.h (or an alternative implementation), but not to report as an HID Device unless I call a function at runtime?

(I asked the same question on stackexchange and realized, that the Arduino community might be the better place to ask these questions.)