Embedding guide for apps and publishers

How to show LoanRepo's three small tools inside your app or article, and optionally an "Add" button. Draft of 17 October 2026. Live examples: in an investing app, beside a loan against holdings, in a neobank Loans tab, in a property shortlist, in a wealth app's goals and in a publisher's article. To get your code in a minute, use the embed code generator.

Three tools

PageForReader enters
widget.htmlPeople who have a home loan: "Has your home loan drifted?"Outstanding balance, rate, EMI, tenure, months paid
widget-buy.htmlPeople about to buy: "Could you cope if rates rise?"Loan amount, tenure, rate quoted, optional take-home income
home-loan-prepay-or-invest-calculator.htmlPeople who hold an investment and have a home loan: "Part-pay the loan, or keep it invested?" Use it after a sale or a withdrawal.Loan balance, rate, months left, amount, return so far, cost of selling

All three take the same options, resize the same way, send a hand-off message, and are counted the same way. Everything below applies to all; replace the page name as needed. The third tool is shown in the same way: add ?partner=yourapp to its address.

1. The simplest way: a link

https://www.loanrepo.in/widget.html?partner=yourapp

Open it in a browser tab or in-app web view. partner is a short tag of 1 to 32 letters, digits, _ or -. It lets you receive an anonymous count of use.

2. Embedded in a page

<iframe id="lr" title="Home loan drift check" height="640" style="width:100%;border:0"
  src="https://www.loanrepo.in/widget.html?partner=yourapp&theme=dark&handoff=1"></iframe>
OptionMeaning
partnerYour tag. Required for counts.
theme=darkOptional. Dark colours.
handoff=1Optional. Shows "Add this to my liabilities" after a result.

If your content security policy restricts frames, allow https://www.loanrepo.in in frame-src.

3. Resizing the frame

Each tool reports the height of its own content, so adding a few pixels of padding in your handler is safe and the frame shrinks again when the content does.

window.addEventListener("message", function (e) {
  if (e.origin !== "https://www.loanrepo.in") return;
  var d = e.data;
  if (d && d.type === "loanrepo-widget-height" && d.height > 200) {
    document.getElementById("lr").style.height = d.height + "px";
  }
});

4. The optional hand-off

With handoff=1, a button appears after the result. Nothing is sent until the user taps it. Then the page sends one message to the page that embeds it:

{ type: "loanrepo-loan-result",
  outstandingBalance: 4421500,
  driftMonths: 49,
  monthsLeftScheduled: 176,
  monthsLeftNow: 225,
  extraPaymentsNominal: 1848378,
  ratePct: 7.9,
  emi: 37722,
  monthlyInterest: 29108,
  remainingInterestNominal: 4065950 }

monthlyInterest is the balance times the rate for one month, and remainingInterestNominal is the payments still to be made at today's EMI and rate, less the balance. Both are rounded and are not offers. They let you show what the loan costs each month beside your own liabilities, such as a loan against holdings.

window.addEventListener("message", function (e) {
  if (e.origin !== "https://www.loanrepo.in") return;
  var d = e.data;
  if (d && d.type === "loanrepo-loan-result" && typeof d.outstandingBalance === "number") {
    // Store under your own consent and privacy terms, then show it beside the user's investments.
  }
});
The message goes to the origin of the page that embeds LoanRepo, taken from the browser's referrer. If your page sends no referrer (a strict Referrer-Policy such as no-referrer), the button will not appear. The default policy strict-origin-when-cross-origin works.

The buyer tool sends this instead, with type: "loanrepo-buyer-result":

{ type: "loanrepo-buyer-result",
  loanAmount: 5000000,
  tenureYears: 20,
  ratePct: 8.15,
  emiToday: 42290,
  emiIfRatesRise2pc: 48749,
  extraMonthlyIfRatesRise2pc: 6459,
  loanRunsYearsIfRatesRise2pc: 29.9,
  rateRiseTenureCanAbsorbPoints: 1.4 }

rateRiseTenureCanAbsorbPoints is how many points the rate can rise before the loan, with the EMI unchanged, would reach the 30-year limit. It is 0 if the loan is already 30 years.

Pre-filling the buyer tool from a listing

You can add price, amount (the loan), tenure (years) and rate (% a year) to the buyer tool's address, for example widget-buy.html?partner=you&price=9800000&amount=7840000&tenure=20&rate=8.5. Use only public listing facts and your own default assumptions, never anything about the user. The boxes stay editable, the check runs only when the user taps the button, and nothing is stored. Values outside sensible limits are ignored.

The part-pay-or-invest tool sends this, with type: "loanrepo-proceeds-result", after the user taps "Add this to my plans":

{ type: "loanrepo-proceeds-result",
  outstandingBalance: 4000000,
  ratePct: 8.9,
  monthsLeft: 200,
  amount: 500000,
  costOfSelling: 10000,
  partPayment: 490000,
  loanCleared: false,
  monthsSoonerSameEmi: 46,
  interestNoLongerChargedNominal: 1313661,
  emiToday: 38435,
  emiLowerKeepingEndDate: 4708 }

These are what the sum shows, not advice and not an offer. The tool does not tell the user to sell or to keep. The result of the comparison is theirs to read.

Pre-filling the part-pay-or-invest tool

Send the figures by message, never in the address. When the page is ready it sends { type: "loanrepo-widget-ready", tool: "prepay-or-invest" } to your page. Reply to the frame's window:

frame.contentWindow.postMessage({
  type: "loanrepo-prefill",
  balance: 4200000, ratePct: 8.75, monthsLeft: 180,
  amount: 300000, returnPct: 7.2, costOfSellingPct: 2,
  kind: "equity-mf"   // equity-mf, debt-mf, fd, insurance, shares, other
}, "https://www.loanrepo.in");

Every field is optional. The page accepts the message only from the page that embeds it, ignores numbers outside sensible ranges, shows a note that the app filled the boxes, and runs the comparison. The user can change any figure. Use only what the user has already given your app, under your own consent terms. Like the hand-off, this needs a referrer (see the note above).

5. Showing it at the right moment

You decide when, from your own data: after a sale credits cash, or in the days after an RBI decision. LoanRepo never receives that data. Show it to every eligible user, not only to people you believe have a home loan. For a publisher, the natural places are an article about an RBI decision or a rate rise (the borrower tool), and a property or EMI-calculator page (the buyer tool).

6. Wording rules

7. Seeing how it is used

We give you an aggregate count of anonymous browsers at each step, with any count below 10 shown as "<10". See the data and privacy note.

Questions: hello@loanrepo.in. The names, fields and options above may change before a launch, and we will tell you in writing.