Skip to main content
Answered

Miro web SDK metadata not working on images

  • February 14, 2025
  • 3 replies
  • 32 views

Forum|alt.badge.img+1

Hi there,

I’ve been trying to add metadata to my images, however it seems like it’s not supported/updated for some reason.

Ways to reproduce:

1. Empty board - add a single image to the board.
2. Console:

const [item] = await miro.board.get();
await item.setMetadata('test', 'data')
await item.getMetadata()

You will see the meta data present on the single item that is on the board - an image.

3. Then close the board and re-open it.
4. Console:

const [item] = await miro.board.get();
await item.getMetadata()


5. It is now empty, no data is saved on the item :(

If I try the exact same thing with a Card, it works just fine.
If I try the exact same thing with a Sticky Note - it also doesn’t work.

I’ve also tried to do item.sync() to see if that would lead anywhere, but it also doesn’t.

It seems like it’s not saving across sessions? If there’s something I’m missing then this is not documented very well in the SDK docs.

Best answer by kirkeskov

I figured out that it only works in the javascript context of the app and not in the javascript dev console (except for cards, but I’ve reported this to support already).

View original
Was it helpful?

3 replies

Forum|alt.badge.img+1
  • Author
  • Beginner
  • 2 replies
  • February 14, 2025

The setAppData / getAppData also seems to be somewhat broken, unless, again, I’m missing something that is not written in the docs.

I have boards:write and boards:read permission in both app and console. 

Edit: okay, this one seems to work if I do it from my app and not the console, however, the first part with the item metadata, doesn’t work as intended.


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 2 replies
  • Answer
  • February 16, 2025

I figured out that it only works in the javascript context of the app and not in the javascript dev console (except for cards, but I’ve reported this to support already).


Horea Porutiu
Mironeer
Forum|alt.badge.img+1

Hey ​@kirkeskov,

Thank you for providing the updates, I will take a look at making the docs more clear for this section. Please let me know if you have any further questions. 


Reply