Paste this into Claude Code (or any AI coding agent) to integrate this plan in your app.
Integrate the Vevee plan "YOUR_PLAN_ID" into my app using @vevee/sdk.
Plan summary
Period: resets monthly, anchored to calendar
On mid-period plan change: carry counters forward.
Events to meter
(none defined yet)
Setup - call once per end-user (signup / login / Stripe webhook):
await vevee.upsertSubscription({ userId, planId: 'YOUR_PLAN_ID' });
Per request - atomic reserve / commit / release:
const r = await vevee.reserve(userId, 'image.gemini-3.1-image', 1);
if (!r.allowed) {
return new Response(JSON.stringify({ error: r.reasons }), { status: 429 });
}
try {
const result = await runTheActualWork();
await vevee.commit(r.reservationId);
return result;
} catch (e) {
await vevee.release(r.reservationId);
throw e;
}
Lightweight check (read-only) - when you don't need atomicity:
const ok = await vevee.canUse(userId, 'image.gemini-3.1-image');
if (!ok.allowed) showUpgradeModal(ok.reasons);
Notes
- Both canUse and reserve are fail-closed: { allowed: false, matched: false } means
the event didn't match any limit group on the user's plan, or no subscription exists.
- track() always records the event (visible in the dashboard's Events tab) regardless
of match status - useful for debugging typos.
- Wire VEVEE_API_KEY (sk_live_…) to the SDK on the server only. Never ship
secret keys in client code.