cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Extract Visual.ts file from pbiviz file

Hi,

 

If I share a  custom visual's pbiviz file which I have developed with someone, can he see the source code or decode it in someway (for e.g the visual.ts and other files).

Is there a way to protect your code?

Regards,

Husain

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
MVP

When you package a Power BI Custom Visuals the TypeScript source like visual.ts is first compiled to JavaScript en then minified (https://en.wikipedia.org/wiki/Minification_(programming)) and stored with all the metadata in one big JSON file, which is zipped and ready to distribute.

 

So yes, everybody that is using your custom visual has the option to 'read' the code you have written. Due to the minification it is not that easy, but not impossible. All CVs are client side scripts and are interpertered by a browser in the client space. And therfor there is no way to protect your code.  

 

-JP 

View solution in original post

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Hmm, perhaps not. If you rename a pbiviz file to zip, you can open it up and the ts file is in the resources directory.

---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted

Hi @Greg_Deckler 

 

I just tried this

I only see the pbiviz.json file in th resources folder 

Highlighted
MVP

When you package a Power BI Custom Visuals the TypeScript source like visual.ts is first compiled to JavaScript en then minified (https://en.wikipedia.org/wiki/Minification_(programming)) and stored with all the metadata in one big JSON file, which is zipped and ready to distribute.

 

So yes, everybody that is using your custom visual has the option to 'read' the code you have written. Due to the minification it is not that easy, but not impossible. All CVs are client side scripts and are interpertered by a browser in the client space. And therfor there is no way to protect your code.  

 

-JP 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.