import svgToEx from "svg-to-excalidraw"; const heartSVG = ` `; const { hasErrors, errors, content } = svgToEx.convert(heartSVG); // SVG parsing errors are propagated through. if (hasErrors) { console.error(errors); return; } navigator.clipboard.writeText(content); // the heart excalidraw json is now copied to your clipboard. // Just Paste it into your Excalidraw session!