I want to include a custom JS and a custom html tag in salesforce lightning component. For example: I want in include a JavaScript webcomponent in LWC. So I need to include a custom js file and custom html tag in component cmp file. But currently cmp file support only some set if html tags.
1 Answer
You're supposed to upload the 3rd party library as a static resource and then reference it in aura/lwc. Exact syntax varies a bit. Or (in aura) you can use https://developer.salesforce.com/docs/component-library/bundle/ltng:require/documentation to load something that will effectively end up in an iframe. (You tagged lwc but your post keeps talking about aura's cmp file...)
3rd party libraries might fail to execute properly due to lightning locker (Salesforce disabling unsafe elements of JavaScript) or "shadow DOM" limiting access to some components internal styling, html and events.
It's a big topic, hard to give you good advice. Try something and post errors you encounter, if any?