Svg export with custom properties

Hello, I have different svg’s in Figma. I would like to export them. However, before exporting I would like to add my own properties (e.g. myProberty=“myID”). I would like to write a plugin for this… Is this possible? And the whole thing then also for several svg’s, so not just always select one and then export.

Thank you very much in advance

Yeah it’s possible. When exporting you get SVG code as a string and you can parse and modify that string as you need.

Yeah cool, thanks for the answer
I’m still quite new to this… are there any examples of how I can implement this?

… or other informations/links etc. …

Thanks :raising_hand_man:

it’s too bad…

  1. Use exportAsync() to get an SVG string.

  2. Use the string replace() method to change parts of it. Or use match() and add some more logic to conditionally replace things in the SVG.

  3. Another way is to use some kind of XML parser library to parse the SVG string, modify it and then compile it back to XML.