An affiliate program for an app you built with Lovable, Bolt or Cursor

You built your app by telling an AI tool what you wanted. You can add an affiliate program in much the same way. You paste three things in three places. A fourth is needed only if your checkout is made in code.
This page shows what to paste where. The examples use Udeely, which runs the whole program in one place: sign-ups, links, sales, renewals, refunds, commission and pay day.
What you are adding
An affiliate program pays people a share of the sales they bring. Each person gets a link. When someone taps the link and later pays, that person is credited and earns commission. You owe commission only when a sale comes in.
For that to work, two things must happen at each sale. Your website must remember who sent the visitor. Your payment provider must report the payment. The pasting below sets up both.
In Udeely: you sign up with your email and your website's address, and a link in your inbox opens your dashboard. It lists four steps: set your commission rate, add your first affiliate, set up tracking, then approve and pay.
Paste 1: the snippet, into your builder

The snippet is one script. It goes in the head of every page of your website, so a visit from an affiliate's link is remembered until the visitor pays.
You don't need to find the right file. Copy the snippet, paste it into your builder's chat, and write: "Add this script to the head of every page." Then publish your site again.
In Udeely: the Tracking page shows your snippet, ready to copy, and says the same: built with Lovable, Bolt or Cursor, ask it to add this script to every page.
Paste 2: the webhook address, into Stripe
A webhook is a message your payment provider sends each time something happens: a payment, a renewal, a refund. You tell Stripe where to send it.
- Copy the webhook address from the Tracking page.
- In Stripe, open Webhooks and add a new destination with that address. Stripe's webhook guide shows the screens.
- Choose the events the Tracking page lists.
Your app may already have a Stripe webhook of its own, for example to switch an account on after payment. Leave it as it is. This is a second one, with its own address and its own secret.
In Udeely: Stripe's messages tell Udeely about each sale, renewal, refund and dispute. A refund takes the commission back by itself.
Paste 3: the signing secret, into Udeely
When you save the webhook, Stripe shows a signing secret that starts with whsec_. It lets Udeely check that a message really came from Stripe. Copy it and paste it into the Tracking page.
Paste it there and nowhere else. It does not belong in your builder's chat or in your app's code.
In Udeely: the secret is stored encrypted. The same step connects Paddle, Lemon Squeezy, Polar, Dodo Payments, Creem and FastSpring. Every one of these connections is new and marked beta. Run one test purchase and one refund first; the Tracking page shows each step arriving.
Paste 4: one line, only if your checkout is made in code
How does your app take payments? If you are not sure, ask your builder: "Does my app use a Stripe Payment Link, a Buy Button, a Pricing Table, or a Checkout Session made in code?"
- Payment Link, Buy Button or Pricing Table: nothing to add. The snippet adds the affiliate's visit to them by itself. A Payment Link is easy to spot: its address starts with buy.stripe.com.
- Checkout Session made in code: your builder has to pass the visit along. Paste it this: "In the browser, wait for
UdeelyMoR.ready(), then readUdeelyMoR.clientReferenceId(). Send that value with the checkout request, and set it asclient_reference_idwhen you create the Stripe Checkout Session. If the value is empty, leaveclient_reference_idout."
In Udeely: the Tracking page shows the line for your payment provider, next to the place where you paste the secret.
Check that it works
Before you invite anyone, do one round yourself. Add yourself as a test affiliate, run a test visit, buy with Stripe's test card, then refund it. How to start an affiliate program for your SaaS walks through the test step by step.
In Udeely: the Is tracking working? panel shows the last visit from an affiliate's link, the last message from your payment provider and the last sale credited to an affiliate. Above them it says Working, Almost, Not yet or Needs a look.
Then find people to share it
A new app has few visitors, so who your first affiliates are matters more than the exact rate. Ask the people who already use your app and already talk about tools like it. Then decide what to pay: How much commission should a SaaS pay affiliates? does the sums.
Affiliates also show you what to say about your app before you spend on ads. Test your ad ideas on affiliates before you pay for ads explains how.
In Udeely: affiliates apply on a sign-up page in your name, and you approve each one. Each gets their own link and their own area, in seven languages. The Posts page then shows which of their posts sell.
Run your whole affiliate program for your app in one place
Udeely runs your whole affiliate program in one place. Affiliates apply on a page in your name and get their own area. Sales, renewals, refunds and disputes come in from your payment provider. You set commission for first payments and renewals, see which posts sell, keep people active with bonuses, campaigns and a leaderboard, and get a list of who to pay. You pay them yourself, and Udeely never holds your money.
It is free for 14 days, with no card. After that Udeely Growth is $49.99 a month, with no share of your sales and no charge per affiliate. See Udeely for software, or start free.
Frequently asked questions
Can I add an affiliate program to an app built with Lovable, Bolt or Cursor?
Yes. You paste one snippet into your builder and ask it to add the script to every page. Then you connect your payment provider by pasting its signing secret into Udeely.
Where does the tracking snippet go?
In the head of every page of your website. Paste it into your builder's chat, ask it to add the script to every page, then publish again.
Do I need to change my checkout?
Not if you use a Stripe Payment Link, a Buy Button or a Pricing Table. If your checkout is made in code, your builder adds one line, and the Tracking page shows which.
Should I paste the signing secret into my AI builder?
No. The signing secret goes into Udeely's Tracking page only, where it is stored encrypted. Your builder only needs the snippet, which is not a secret.
What if I don't sell with Stripe?
Udeely also connects to Paddle, Lemon Squeezy, Polar, Dodo Payments, Creem and FastSpring. All of these connections are new and marked beta, so test with one purchase and one refund first.
Ready to start your program?
Udeely is free for 14 days, with no card. Then it is $49.99 a month, with no share of your sales. See Udeely for software.
Start free