Skip to main content

SDK / Getting started

Getting started

Add a Bestrao calculator to any page with a script tag. No build step required.

1. Add a mount point

<div id="calculator"></div>

2. Load the SDK

<script src="https://bestrao.com/sdk/v1/bestrao.min.js"></script>

3. Render a tool

Bestrao.render({
  target: "#calculator",
  tool: "emi-calculator",
  theme: "auto",
  locale: "en-IN",
  currency: "INR",
  onResult(result) {
    console.log(result);
  },
});

React / Next.js

Load the script once (in _document / layout) or import the ESM build, then call Bestrao.render inside useEffect. Destroy the widget on unmount.

useEffect(() => {
  const widget = Bestrao.render({ target: ref.current, tool: "bmi-calculator" });
  return () => widget.destroy();
}, []);

Next: API reference · Playground