The widget, on a shop's website
One script tag with your publishable key. Customers check their balance or join without leaving the shop's site. Use +91 00000 12345 and the code 000000 in test mode.
Add it to a page
Paste this where the card should appear, with the shop's publishable key:
<div data-nimbuu-widget></div>
<script src="https://nimbuu.in/widget/v1.js" data-key="pk_test_..." async></script>
It takes the shop's name, logo and colour from Nimbuu. Add data-lang="hi" to the script tag for Hindi; without it the widget follows the page's lang, then the browser. Visitors can switch between English and Hindi. Use a pk_test_ key while you build: the widget shows "Test mode", takes test numbers and the code 000000. Try it on the demo page.
Load it from our address and don't pin it with a subresource integrity hash: v1.js gets fixes, but only changes that keep working with your page. A change that would break a page will come as v2.js.
What the visitor sees
The top of the widget is in the shop's colour, with its logo and name. At the bottom the visitor can switch between English and Hindi.
- Their phone number after a fixed +91, then "Send me a code".
- The 6-digit code we send by SMS. "Send again" works after 45 seconds.
- A customer with a card sees their stamps or points, the next reward, and "Open my full card". The full card is its own page, so it asks for a new code once. "Not you?" starts again with another number. A new number sees what the shop keeps and why, can switch on WhatsApp messages, and taps "Make my card".
Limits
A publishable key can make 30 a minute calls from one IP address, and 600 a minute in all. A visitor uses five or six calls to see their card or join, so many visitors on one shop's Wi-Fi share that budget. Codes have their own limits, on Errors and limits.
What it keeps
It sets no cookies. In sessionStorage it keeps the member's id and a read-only member token for 30 minutes, never the phone number, and clears them on "Not you?" or when the tab closes.
Content Security Policy
The widget uses no inline script, no eval and no fonts. If your site sends a Content-Security-Policy, add our address to three lines:
script-src https://nimbuu.in
connect-src https://nimbuu.in
img-src https://nimbuu.in
Your own form
You can build your own with the same calls and a publishable key: POST /v1/otp/send, POST /v1/otp/verify, then POST /v1/members with "create": false to find the card. An answer of {"found": false} means a new number: show the notice before you call POST /v1/members again to make the card, and send message_consent only if they ticked it. Then read the balance with GET /v1/members/{id} and GET /v1/rewards. See Authentication.