Skip to content
Functiondiscord-component-embedv1.0.0

toComponentEmbedScript

Returns the <script> tag Discord reads for a component embed, as an HTML string. Use it where you write raw HTML into the page yourself.

Throws:

  • a ComponentEmbedError when the tree breaks a rule of the format, or when your own code throws while the package reads it.

toComponentEmbedScript(root: EmbedElement): string