function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Virendra Kumar 9Virendra Kumar 9 

Is it possible to restrict the use of lightning component on some specific websites

Hi All

I am trying to use lightning out functionality to embed my ligthning component on some public webistes and i want it should be used there only.

Please let me know if there is any way to restrict the usuage to same.
Best Answer chosen by Virendra Kumar 9
Ravi Dutt SharmaRavi Dutt Sharma
You can store the whitelisted websites in a custom setting. In the init of your component, check the page url or domain and compare if it exists in the custom setting. Only if it exists, you initialize the component. Else, set an error message.

All Answers

Ravi Dutt SharmaRavi Dutt Sharma
You can store the whitelisted websites in a custom setting. In the init of your component, check the page url or domain and compare if it exists in the custom setting. Only if it exists, you initialize the component. Else, set an error message.
This was selected as the best answer
Virendra Kumar 9Virendra Kumar 9
Nice one, Thank you so much Ravi