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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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.

Follow on LinkedIn
@ 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!:
The Definitive Guide to Power Query (M)

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Kudoed Authors