- Home
- Skills
- E-commerce
- Lemon Squeezy Developer Agent
Works with the AI Agents you already use
Lemon Squeezy Developer Agent
Developer reference for Lemon Squeezy e-commerce: checkout overlays, HMAC-SHA256 webhooks, subscription lifecycles, and software license key validation.
Free
Lemon Squeezy Developer Agent
Example session with this skill installed
How do I verify a Lemon Squeezy webhook in a Next.js Route Handler and what events should I listen for to handle new subscriptions?
- Read your context and instructions
- Compiled the lemon squeezy developer
To verify webhooks in Next.js, you must access the raw request body. Using the parsed JSON will cause HMAC verification to fail due to whitespace differences. For subscription management, you should primarily listen for subscription_created and subscription_updated.
Webhook Implementation Logic
| Task | Implementation Detail |
|---|---|
| Signature Header | X-Signature |
| Algorithm | HMAC-SHA256 |
| Comparison | Use crypto.timingSafeEqual |
| Primary Events | subscription_created, subscription_updated, subscription_cancelled |
| Currency Format | Cents (Integer) |
import crypto from 'crypto';
export async function POST(req: Request) {
const rawBody = await req.text();
const hmac = crypto.createHmac('sha256', process.env.LEMON_SQUEEZY_WEBHOOK_SECRET!);
const digest = Buffer.from(hmac.update(rawBody).digest('hex'), 'utf8');
const signature = Buffer.from(req.headers.get('x-signature') || '', 'utf8');
if (signature.length !== digest.length || !crypto.timingSafeEqual(digest, signature)) {
return new Response('Invalid signature', { status: 401 });
}
const payload = JSON.parse(rawBody);
const eventName = payload.meta.event_name;
switch (eventName) {
case 'subscription_created':
// Logic for new subscription
break;
case 'subscription_updated':
// Logic for renewals or plan changes
break;
}
return new Response('OK', { status: 200 });
}
Next steps
- Set your
LEMON_SQUEEZY_WEBHOOK_SECRETin your.envfile. - Configure the Webhook URL in your Lemon Squeezy Dashboard under Settings > Webhooks.
- Test the integration using the "Send Test" button in the dashboard to verify the HMAC logic.
Connects securely to your tools. The creator never sees your data.
About this skill
Integrating payments often leads to broken webhook signatures and lost subscription states. This skill provides the architectural technical reference and implementation logic for Lemon Squeezy, ensuring your billing system handles webhooks, licensing, and checkouts without common security or state-machine errors.
What it does
- Secure Webhooks provides logic for HMAC-SHA256 signature verification and event handling for order and subscription updates.
- Checkout Management generates dynamic checkout URLs and configures Lemon.js overlays for embedded modals.
- Subscription Lifecycles manages plan upgrades, downgrades, pauses, and grace period logic for cancellations.
- License Validation handles software license activation, deactivation, and instance tracking via public endpoints.
- API Architecture implements JSON:API specifications including relationships, filtering, and pagination.
How it works
- Identify Scope by determining if the task involves webhooks, checkouts, subscriptions, licensing, or raw API queries.
- Consult Reference by retrieving specific implementation details from the included developer guides and security manuals.
- Apply Security by implementing timing-safe signature checks and raw body processing for incoming events.
- Validate State by checking subscription attributes like
ends_atto ensure customers retain access during grace periods.
Frameworks & tools
Works with any stack including Next.js, Node.js, Laravel, Python, WordPress, and mobile or desktop apps. Utilizes Lemon.js and the Lemon Squeezy JSON:API.
Why this beats prompting it yourself
Standard LLMs often hallucinate Lemon Squeezy's specific JSON:API structure or fail to warn about raw body requirements for webhook verification. This skill forces strict adherence to timing-safe equality checks and correct integer-based currency handling.
Use cases
- Building a SaaS billing dashboard with subscription lifecycle management.
- Implementing secure license key activation for desktop software or plugins.
- Setting up a conversion-optimized checkout overlay with custom metadata.
- Automating internal workflows triggered by secure
order_createdwebhooks.
Known limitations
Requires a Lemon Squeezy account and API credentials. Does not provide a UI component library; focuses on logic and architectural integration.
Pair with Fastr MCP Suite
For live signature verification tools and remote license validation endpoints, connect our companion MCP server on MCPize: 👉 Fastr MCP Suite on MCPize
Requires Lemon Squeezy account credentials. Does not include pre-built UI components. Webhook verification requires access to the raw request body before JSON parsing.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 19 days ago
- Free with an Agensi account