Anything that happens client-side in Anvil is happening through Javascript. Anvil just does a good job of hiding that from you and allowing you to write Python.
For anything that Anvil doesnāt support in Python (like connecting to a Bluetooth device), you have to use the Javascript bridge. How easy or hard that is depends entirely on the Javascript library youāre trying to use.
Hereās a post showing one particular integration: Embedded interactive visualisations in Anvil using e.g. Vega Lite? - #2
And here are the docs on using Javascript from your Python code: Anvil Docs | Using JavaScript
One of the really cool things about the Anvil/Javascript bridge is that you can pass Python functions as Javascript callbacks, so you can work with many Javascript libraries entirely from inside form code.