Create file

hey, I want to create file in figma from plugin side, before i was using openURL and backend:

but for long files it doesnt work beacuse url is too long and browser shows me “invalid page”, i tried doing it with fetch too but cors blocks it, when i try to allow url in manifest.json it throws me error that localhost:8080 is invalid url… any idea how can i create file?