# toComponentEmbedJson

`function` in `discord-component-embed` · v0.4.1

<https://docs.seedcord.org/packages/discord-component-embed/0.4.1/functions/to-component-embed-json>

Returns the component embed's JSON as a string. It escapes `</` and `<!--` to keep text in the card from closing the `<script>` tag early. Use it when your framework writes the tag itself and takes the JSON as its content.

```ts
toComponentEmbedJson(root: EmbedElement): string
```

Returns the component embed's JSON as a string. It escapes `</` and `<!--` to keep text in the card from closing the `<script>` tag early. Use it when your framework writes the tag itself and takes the JSON as its content.

Parameters.

- `root` `EmbedElement`

Returns `string`.
