Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Husain
Advocate I
Advocate 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
jppp
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
jppp
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 

Greg_Deckler
Super User
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

 

I just tried this

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors