Skip to main content
Two paths: MCP or one HTTP call. Use infi_onboard over MCP stdio (npx -y @beinfi/mcp) when the editor supports that transport. With no shell and no MCP, the agent provisions through the API below. The agent onboarding guide covers the required versions, the questions, and resuming the same account.

1. Prepare the account

The agent first looks for an existing Infi integration in the app. If there is one, it reuses that account. For a new integration, it asks for an email, the app name and the billing intent. With the answers it calls infi_onboard or makes the POST below with the real values:
The response carries apiKeySecret (sk_test_*, once only), publishableKey (pk_test_*), accountName, tenantSlug, expiresAt, the seed productId and the claimUrl (https://app-sandbox.beinfi.com/claim/{id}). The ref: "lovable" is what marks the tenant’s signup_source. Field by field in quickstart. The agent hands the claimUrl back and continues the integration in the sandbox. With the claim-email update, supplying an address also queues a notice with the account name, the link and the deadline. Delivery is asynchronous and limited to one notice per address every 24 hours. The email does not contain the keys; 201 confirms creation, not delivery. You sign in to Infi later, through the link from the conversation or the email, and take over the same account. The default window is 30 days; the returned expiresAt is what counts. The name is already filled in, and products, keys and slug are preserved. Do not create another account if the email is slow. Details in Claim.

3. Env in the Lovable app

Save INFI_SECRET_KEY in your server functions’ secrets. Only INFI_PUBLISHABLE_KEY may be exposed in the browser when a client API requires one; it is Infi’s, not the payment provider’s. Never expose the secret in a VITE_* variable. The agent needs neither your password nor a verification code. Do not set INFI_AUTH_BASE_URL / INFI_PAY_BASE_URL — they are legacy and nothing reads them. The hosts come from the key’s prefix.

4. Create the product

The seed product is good for neither selling nor metering (version in draft, no meter). Create and publish your own — three calls in catalog. Keep the productId: it goes into the payment link, checkout() and every usage event.

5. Integrate the SDK

Infi does not log your user in — use the auth the app already has (Supabase, in the typical Lovable case) and pass that id to Infi.
To charge, send a payment link. To know they paid, polling in sandbox — registering a webhook answers 503 with a test key.

MCP tools

A reference for what the MCP server exposes. Point your MCP client at it like this: