Skip to main content
Answered

Error: 'url' field is required for ImageWidget


Daniel Wirtz
Forum|alt.badge.img+3

I’m currently trying to create images on a Miro board using the SDK. 

I have the images stored as base64 data URLs. But it seems the method isn’t accepting that format. 

Here the code I’m using: 

miro.board.widgets.create({
 "type": "image",
 "url": "data:image/png;base64,iVBORw0KGgoAA..."
})

The error message I get: 

Error: 'url' field is required for ImageWidget

Does the method only accept regular url’s? I wasn’t able to find an answer in the docs. 
 

Best answer by Anthony Roux

Hi @Daniel Wirtz,

 

The current version of the SDK only supports Image widget creation from an existing URL (a hosted image). It does not support a base64 encoded image.

 

I will raise this requirement to the technical team to have it in our backlog.
 

 

View original
Was it helpful?
100% found this helpful

3 replies

Anthony Roux
Mironeer
Forum|alt.badge.img+1
  • Mironeer
  • 215 replies
  • Answer
  • August 2, 2021

Hi @Daniel Wirtz,

 

The current version of the SDK only supports Image widget creation from an existing URL (a hosted image). It does not support a base64 encoded image.

 

I will raise this requirement to the technical team to have it in our backlog.
 

 


Daniel Wirtz
Forum|alt.badge.img+3
  • Author
  • Miro Hero
  • 9 replies
  • August 2, 2021

I thought this would be the only option. But if possible I would rather use the base64 encoded images, because then everything can stay inside the plugin and it’s more privacy friendly. 
 


Hi @Anthony Roux, it would also be great to be able to define image widgets via a “data:image/svg+xml” scheme/mime-type -- for small icon like images it would allow to avoid storing images in a server with an absolute url, allow to create/update images programmatically from the plugin etc. It would definitely be a highly valuable feature.


Reply