Hi
I am not clear which exact operation you are doing. Do you create custom visuals in Power BI? If that is the case, you can review the following link about how to add external libraries.
https://github.com/Microsoft/PowerBI-visuals/blob/master/Tutorial/ExternalLibraries.md
Moreover, you can check this link about how to build Power BI visuals.
Thanks,
Lydia Zhang