A backend for your Figma plugin.
Plugin devs already write to localStorage and pray. PerSQL gives every plugin its own SQLite, scoped per document or per user, queryable from the plugin sandbox in three lines.
MCP endpoint
Point your coding agent at:
https://figma.persql.com/mcp
Authenticate with a PerSQL bearer token. Tools: figma_install_list, figma_discover_files, figma_register_file.
Plugin recipe
// Inside your Figma plugin (manifest.json: networkAccess.allowedDomains has api.persql.com)
const r = await fetch("https://api.persql.com/v1/db/myteam/my-plugin/query", {
method: "POST",
headers: {
Authorization: "Bearer " + PERSQL_TOKEN,
"Content-Type": "application/json",
},
body: JSON.stringify({ sql: "SELECT * FROM saved_layouts WHERE user_id = ?", params: [figma.currentUser.id] }),
});
const { data } = await r.json();