Building an OSC connection between Supercollider and P5JS

I haven’t used P5Js, but maybe this library could be helpful.

In SuperCollider you can check the OSC Communication help file. You can send and receive OSC messages fairly straightforwardly.