Using api from custom component

Thank you. I had placed this code in the body section.

It’s surprising to me that the head behavior here is different. It looks like Discourse is removing these api snippets from the body section. Other script elements are retained there.