Figma plugin API integration not working properly

I’m working on a Figma plugin that needs to get information from an external API but I can’t get it to work correctly. The console isn’t showing any data even though my code looks right to me.

if (msg.type === "generate-shapes") {
    console.log("Button click detected");
    (async () => {
        const apiCall = await fetch("https://jsonplaceholder.typicode.com/users", {
            method: "GET",
            headers: {
                "Content-Type": "application/json",
                "Access-Control-Allow-Origin": "*",
            },
        });

        const result = await apiCall.json();
        console.log("API response:", result);
    })();
}

I also updated my manifest.json file to include network permissions:

"networkAccess": {
    "allowedDomains": [
        "https://jsonplaceholder.typicode.com/"
    ]
}

The problem is that nothing appears in the console when I test the plugin. I expected to see the API data but it’s just not happening. Does anyone know what could be going wrong here? I’m pretty new to Figma plugin development so maybe I’m missing something obvious.

you’re checking the wrong console. figma plugins run in a sandbox, so you need to check the dev console in the plugin window itself, not your main browser console. right-click inside your plugin ui and hit inspect element to see the actual logs.