Read the Figma User ID
On plugin load, call figma.currentUser.id. This permanent, unique Figma-issued ID becomes the user's identity in your token system β no sign-up form, no email required.
Four steps to add a complete token payment system to any Figma plugin β using the BalancYZ API, Lemon Squeezy, or Stripe.
On plugin load, call figma.currentUser.id. This permanent, unique Figma-issued ID becomes the user's identity in your token system β no sign-up form, no email required.
Call POST /clients with the Figma ID as client_id. Idempotent β a 409 means they already exist and is safely ignored.
Build a Lemon Squeezy or Stripe checkout URL with client_id=userId. After payment, BalancYZ verifies the webhook signature and credits the user's token balance instantly.
Fetch balance via GET /clients/{'{userId}'}, then deduct via POST /clients/{'{userId}'}/debit. A 402 triggers your "Buy Tokens" upsell.
Five steps to go from a Figma user opening your plugin to tokens credited in their balance β fully automated, no manual work required.
When your plugin launches, read the built-in figma.currentUser object. No login screen, no OAuth, no cookies β Figma provides a guaranteed unique ID for every user.
POST /clientsSend the Figma user ID to BalancYZ on every plugin open. The endpoint is idempotent β calling it multiple times is safe and expected. A 409 just means the user already exists.
metadata to store plugin version, country, etc.Redirect the user to a Lemon Squeezy or Stripe checkout URL. Pass the Figma user ID in the checkout metadata β this is how BalancYZ knows which client to credit after payment.
π Lemon Squeezy
?checkout[custom][client_id]=USER_ID to your checkout link/webhook/lemon/{'{id}'} in LS dashboardorder_created, subscription_payment_successπ³ Stripe
metadata: { client_id: USER_ID } on the Checkout Session/webhook/stripe/{'{id}'} in Stripe dashboardcheckout.session.completedAfter payment succeeds, your payment provider POSTs to the BalancYZ webhook URL. BalancYZ verifies the cryptographic HMAC signature to ensure the request is genuine β only then does it credit the client.
client_id from meta.custom_data (LS) or metadata (Stripe)Tokens appear instantly in the client's balance. Your plugin checks balance before each premium action, then debits after it completes. A 402 response means zero balance β show your upsell UI.
GET /clients/{'{userId}'} β read balance fieldPOST /clients/{'{userId}'}/debit with { "amount": 10 }The Figma plugin API is just JavaScript. If you can build a web app, you can build a Figma plugin β and sell it to 10 million paying designers.
Figma plugins run TypeScript + HTML/CSS in a sandboxed iframe. The main plugin thread talks to the Figma API β it reads like jQuery: figma.createRectangle(), figma.currentUser.id. No new language to learn.
Figma Community is a built-in marketplace with 10 million active designers already inside the tool. No App Store review. No install friction. Publish your plugin and it's live for everyone β searchable the same day you ship.
No App Store approval, no review queue, no API key restrictions. Push your code, update the manifest, and your changes are live. You can ship, iterate, and monetize on your own schedule β in a weekend if you want.
Independent developers β not big companies β built the top Figma plugins. They earn recurring revenue from a single TypeScript file.
Figma to Code
HTML, Flutter, React generation
600,000+ installs. One developer. Converts Figma designs to production code β simple token-based approach that charges $0.10β$0.50 per export.
AI Plugins (2024 Wave)
Copywriting, image gen, component AI
The fastest-growing category. Pay-per-generation pricing maps perfectly to token economics β 10 tokens = 1 AI generation = ~$0.10. Users understand it instantly.
Automator & Scripter
Workflow automation plugins
Bulk operations, export automation, style sync. Power users pay happily for time saved β 100+ tokens/month for daily-use productivity tools.
100
tokens = $1.00 pack
10 AI generations
10
tokens per action
= $0.10 per use
500
users Γ 5 uses/mo
= $250/mo passive
$0
upfront engineering
BalancYZ handles it all
manifest.jsonIf you know the DOM API, you already understand 80% of the Figma plugin API. The mental model is the same.
// Create an element
const div = document.createElement('div');
div.style.width = '200px';
div.style.height = '100px';
div.style.backgroundColor = '#7c3aed';
document.body.appendChild(div);
// Get current user
const user = navigator.userAgent; // π¬ not great
// Show a message
alert('Hello!');
// Create a shape
const rect = figma.createRectangle();
rect.width = 200;
rect.height = 100;
rect.fills = [{ type: 'SOLID', color: { r: 0.49, g: 0.23, b: 0.93 }}];
figma.currentPage.appendChild(rect);
// Get current user β¨ trivial!
const userId = figma.currentUser.id;
// Show a message
figma.notify('Hello!');
{
"name": "My Figma Plugin",
"id": "your-plugin-id",
"api": "1.0.0",
"main": "dist/code.js", // your TypeScript, compiled
"ui": "dist/ui.html" // your React/HTML iframe UI
}
Six milestones, one weekend. Each one builds directly on the last β no dead ends, no wasted effort.
Use the official Figma plugin samples repo or a TypeScript + Vite template. You get a working plugin skeleton with hot-reload in under 5 minutes.
Build your core feature using the Figma API. The API covers: reading/creating nodes, selection, styles, components, variables, and more. Test live in Figma desktop with one-click reload.
Create a free BalancYZ account. Get your API token. Configure which webhook provider you'll use. Your token economy backend is ready β no server, no database setup required.
Add to your plugin: register user on open, check balance before gating, debit after each premium action. That's the entire integration β 3 fetch calls total.
Create a token pack product (e.g. "100 Tokens β $1"). Paste your BalancYZ webhook URL into the LS dashboard. Payments auto-credit user balances. No manual work ever.
Submit your plugin to Figma Community. Write a clear description with a demo GIF. Your plugin becomes searchable by 10M+ designers immediately after approval.
Without BalancYZ, adding payments to a Figma plugin means building auth, a database, webhook verification, and balance tracking from scratch.
POST /clients β register a user by Figma ID. Done.GET /clients/{'{id}'} β fetch balance. One line of code.POST /clients/{'{id}'}/debit β charge for a premium action.If you've had any of these thoughts, here's the real answer.
| π Fear | β The Reality |
|---|---|
| "Figma plugins can't call external APIs" | They absolutely can. Plugins run in an iframe with full access to fetch(). Call your backend, BalancYZ, or any REST API freely. |
| "I need a backend to store user data" | BalancYZ is your backend. Client storage, balance tracking, and transaction history are all handled. You don't deploy a single server. |
| "How do I charge users inside Figma?" | Open a Lemon Squeezy checkout URL in the browser (figma.openExternal(url)). After payment, BalancYZ credits the balance automatically via webhook. |
| "What if nobody uses it?" | Figma Community has built-in search with 10M+ users browsing weekly. A plugin that solves a real problem will get organic installs from day one β with zero marketing spend. |
| "Plugin dev requires a Figma developer account" | Any Figma account can create and test plugins locally. You only need a developer account to publish β and it's free to apply. |
| "I'll get rate-limited or banned if I call APIs" | Plugins call your own backend, not Figma's API. There are no rate limits on your own endpoint. BalancYZ is designed specifically for high-frequency plugin calls. |
This 30-line skeleton is everything you need. Drop it into any Figma plugin and you have a full token economy working in one sitting.
// βββ BalancYZ Token Skeleton βββββββββββββββββββββββββββββββββ
// Route all API calls through YOUR backend proxy.
// Never put the API token directly in plugin code.
const BACKEND = 'https://your-backend.com/api';
async function initPlugin() {
const userId = figma.currentUser?.id;
if (!userId) { figma.notify('β οΈ Could not identify you.'); return; }
// 1. Register (idempotent β safe every plugin open)
await fetch(`${BACKEND}/register`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: figma.currentUser.name, client_id: userId })
}); // 201 new β
409 exists β
β both are success
// 2. Fetch balance
const { balance } = await fetch(`${BACKEND}/balance/${userId}`)
.then(r => r.json());
figma.ui.postMessage({ type: 'balance', balance });
}
async function runPremiumAction(userId: string) {
// 3. Debit 10 tokens after the action completes
const res = await fetch(`${BACKEND}/debit/${userId}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ amount: 10 })
});
if (res.status === 402) {
// Show buy tokens UI β open Lemon Squeezy checkout
figma.openExternal(`https://your-store.lemonsqueezy.com/buy/xxx?checkout[custom][client_id]=${userId}`);
return;
}
// β
Debit succeeded β run your actual feature here
figma.notify('β¨ Done! 10 tokens used.');
}
figma.on('run', initPlugin);
3
API calls total
~30
lines of code
15 min
to working monetization
The Figma Community plugin ecosystem is thriving. Developers with no design background are shipping profitable tools used by hundreds of thousands of designers.
TypeScript Developer, indie plugin author
via Figma Community
"I built my plugin in a week using TypeScript skills from my day job. It hit 10,000 installs in the first month. I had no idea the audience was this big."
Frontend developer, AI plugin creator
via X (Twitter)
"Adding pay-per-use to my Figma plugin was the best decision I made. Users prefer tokens over subscriptions β they feel in control. Revenue is now consistent MRR."
10M+
Monthly active Figma users
2,000+
Community plugins published
$0
Marketing spend needed to get first users
1 wknd
From zero to published plugin
Create your free BalancYZ account β copy the starter code above β publish to Figma Community. You have all the skills. The audience is waiting.
By end of the weekend you'll have:
No credit card required. Free plan includes everything you need to get started.
Whether you charge per generation, per month, or offer a lifetime deal β all three models run on the same Figma user ID with no extra auth setup.
Users buy packs of 100, 500, or 1,000 tokens. Each Figma plugin action debits a fixed amount. Zero upfront cost removes the purchase barrier and maximises conversion.
Best for: AI-generative Figma plugins
// Debit tokens after a premium action completes
const res = await fetch(
`https://your-backend.com/proxy/clients/${userId}/debit`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ amount: 10 })
});
if (res.status === 402) {
// Insufficient balance β show upsell UI
figma.openExternal(`https://your-store.lemonsqueezy.com/buy/xxx`
+ `?checkout[custom][client_id]=${userId}`);
return;
}
// 200 OK β debit success β
const { balance } = await res.json();
figma.notify(`β
Done! ${balance} tokens remaining.`);
Whether you charge per generation, per month, or offer a lifetime deal β all three models run on the same Figma user ID with no extra auth setup.
Users buy packs of 100, 500, or 1,000 tokens. Each Figma plugin action debits a fixed amount. Zero upfront cost removes the purchase barrier and maximises conversion.
Best for: AI-generative Figma plugins
Monthly subscription grants plugin access plus a token allowance. Users top up extra credits when needed. Predictable MRR with a built-in upsell path.
Best for: Feature-rich AI Figma plugins
Define monthly or lifetime plans in BalancYZ and auto-assign on client registration. Gate plugin features by checking plan_expired_at in the client response.
Best for: Utility & productivity Figma plugins
Common questions about Figma plugin monetization with BalancYZ.
Register users by figma.currentUser.id via POST /clients. Sell token packs via Lemon Squeezy or Stripe. BalancYZ auto-credits balances via webhook. Deduct tokens on each premium action via POST /clients/{'{userId}'}/debit.
Yes. Set your Lemon Squeezy webhook destination to /webhook/lemon/{'{webhook_id}'} and add checkout[custom][client_id]=FIGMA_USER_ID to your checkout URL. BalancYZ verifies the HMAC and credits the correct user automatically.
No. BalancYZ uses the client_id_only method. Users are registered silently using their unique figma.currentUser.id. No password, no email, no sign-up form required.
No. Never expose your API token inside Figma plugin source code β plugin code is client-side and inspectable. Route all BalancYZ calls through a backend proxy such as a Laravel or Node.js endpoint that holds the API token securely server-side.
Yes. BalancYZ has a free plan with no credit card required. Paid plans unlock higher client limits and additional features as your Figma plugin user base grows.