API Authentication Question

Hi all,

I’m building a little hardware device (linux/Python app) which will use the Home Assistant API, accompanied by a custom addon for managing and adding to the system.

I’ve been able to manually test the API by copying over a long lived access token which works great.

My question is, to make the setup process easier I’d like to use my addon to add the device to HA at the click of a button from a web gui, what are my options here for the authentication part? Is it just a case of presenting the token to my addon through the gui or config page and have this send to my device at the adding stage, or should I be looking at another/better solution? I was able to create JWT tokens between the addon and device and this was seen as a refresh token in HA but using with the API always returned ‘Unauthorized’.

Any help appreciated, this is my first time attempting integration with HA!

Thanks
J