I built plugins for three editors. Everywhere, you're a guest in someone else's house
Over the last while I've built integrations for three places where people work with text and images: Obsidian , VS Code, and Figma. Doing a few of them back to back, I noticed something you don't see from a single one. They're all desktop apps. For your integration to exist at all, the person first installs a program on their machine, and then, inside it, your plugin. You're not writing for the…
During a recent project, I developed plugins for three different text and image editing applications - Obsidian, VS Code, and Figma. It quickly became apparent that despite all being desktop apps, each had its own unique approach and restrictions.
To create an integration, users must first install a program on their machine, after which the plugin runs within that program's environment. This runtime, along with its own set of rules, presents challenges for developers. The web, in contrast, typically allows for straightforward HTTP requests, but working within someone else's sandbox requires earning access to these resources.
Figma proved to be the most restrictive host among the three. Despite the task seeming simple at first glance - select a frame, write a caption, choose social accounts, and publish without exporting the image - there were several complexities involved.
Figma provided raw PNG bytes instead of a file, necessitating additional steps to upload it. The plugin first creates a post, obtains an upload URL, PUTs the PNG, completes the media, and then updates the post. This sequence ensures the image is correctly uploaded and processed.
Additionally, the plugin UI runs in a sandboxed iframe with Origin: null, making it impossible for the plugin to directly communicate with the API. A Cloudflare Worker was implemented to forward requests and add the necessary CORS headers.
Other considerations include handling character limits across different social media platforms - LinkedIn allows more text than X, so the plugin uses the strictest limit among the selected networks. The plugin also prevents users from scheduling posts if the image fails to upload, ensuring a smooth user experience.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.