Hi,
I am testing Miro REST API and WEB SDK and, so far, everything is woring fine.
My current test is calling an external API from WEB SDK App, but it is not working.
Is the ( API call ) code below valid for Miro ?
It works perfectly well in a normal React site.
As you can see in the code this example uses a non-authenticated and CORS enabled URI.
Thanks
import * as React from 'react';
import {createRoot} from 'react-dom/client';
import { useState, useEffect } from 'react'; // API
async function addSticky() {
const data, setData] = useState(null);
useEffect(() => {
fetch("https://contabo.easylob.com:5443/echo?origin=Miro")
.then(response => response.json())
.then(json => setData(json))
.catch(error => console.error(error));
}, ]);
const stickyNote = await miro.board.createStickyNote({
content: 'Hello, World!',
});
await miro.board.viewport.zoomTo(stickyNote);
}
const App = () => {
React.useEffect(() => {
addSticky();
}, ]);
return (
...
);
};