Working with webfig javascript

I am a hap ac2 owner and working on another API client for personal use.

It seems that javascript codes on webfig might be a reasonable start point for another API client.
I can avoid implementing everything struggling with libraries and/or TCP things.

My question is, that if I refer to the javascript code for my own code, is there any problem when I share my code e.g. upload my code on github? like a legal issue or something?