Insurtech brokers
Add the script tag
Add Kinro's commercial insurance quote experience to your web app with one script tag. Prefill and webhooks are optional upgrades.
Add Kinro's commercial insurance quote experience to your website or web app with one script tag. Customers answer only the questions Kinro needs, review live carrier quotes in your page, and continue to Kinro checkout when they're ready to buy.
1. Get your partner ID
Ask your Kinro partnership contact for:
- Your public partner ID (
ap_...orprt_...). It is safe to put in browser HTML. - Allowed origins. Register every staging and production
https://origin that will load the widget. Kinro rejects requests from other origins. - Partner tokens, only if you will prefill or receive webhooks: separate
testandlivekinro_pk_*tokens, kept on your server. - Activation. Kinro activates your partner account after the integration review in Sandbox & go-live. On your registered sites, anonymous visitors can open the widget only after activation; before it, the widget emits
errorwithcode: "unauthorized".
2. Add the script tag
Include embed.js on your approved origins:
<script
src="https://kinro.com/partners/embed.js"
data-partner="YOUR_PARTNER_ID"
defer
></script>Script attributes
| Attribute | Required | Description |
|---|---|---|
data-partner | Required | Your public partner ID (ap_... or prt_...). |
data-customer-token | Optional | Short-lived kct_* token minted on your server via upsert_lead (mint_customer_token: true). Held strictly in memory. |
data-launcher | Optional | button shows a floating quote button; none hides it. Defaults to button, or none when [data-kinro-inline] is present on the page. |
data-placement | Optional | Placement label such as onboarding_checklist or insurance_tab (up to 80 characters). |
data-open | Optional | Set to true to open the popup modal immediately after the script loads. |
data-nonce | Optional | Content Security Policy (CSP) nonce applied to the widget's <style> elements. |
data-mcp-url | Optional | Kinro endpoint the widget talks to. Set it to https://api-preview.kinro.com/mcp to test against the preview endpoint; leave it out in production. |
3. Place inline or open from your own UI
To render the quote experience directly inside a page section, add a container with data-kinro-inline:
<div data-kinro-inline data-placement="insurance_tab"></div>A container can set its own data-partner when one page hosts quote experiences for more than one of your partner IDs; otherwise the script's data-partner applies.
The inline widget grows with its content up to 680px, then scrolls inside, with the question box always in view. To change that height, set --kinro-max-height on the container, for example style="--kinro-max-height: 560px".
When a step asks for a phone number or email, the widget shows Kinro's contact disclosure above the submit button. The contact details are saved only when submitted under it. A visitor who opened the widget without a customer_token becomes a lead at that moment: a live lead on your registered sites, a test lead on a local development page. Before that, nothing appears in list_leads.
Customers can submit a follow-up while the widget is waiting for an answer. If the wait expires, Check for replies reads the conversation again without submitting the question again.
The widget runs the whole conversation with Kinro. You do not need to send or poll conversation messages yourself. Your server can optionally prefill customer details, receive webhooks and list leads and policies.
JavaScript API (window.Kinro)
For single-page apps (React, Next.js, Vue) or custom trigger buttons, use window.Kinro:
| Method | Description |
|---|---|
Kinro.mount(element, { placement?, customerToken?, nonce? }) | Mounts an inline quote view inside element. Mounting again replaces the previous instance cleanly. |
Kinro.unmount(element) | Unmounts and cleans up the inline view when your component unmounts. |
Kinro.open({ placement?, customerToken? }) | Opens the modal dialog. |
Kinro.close() | Closes the modal dialog and restores keyboard focus to the element that opened it. |
Kinro.toggle(options?) | Opens or closes the modal dialog. |
Kinro.isOpen() | Returns true while the modal dialog is open. |
Kinro.on(event, handler) / Kinro.off(event, handler) | Subscribes or unsubscribes to lifecycle events. |
4. Lifecycle events
Subscribe to events to track funnel progression in your analytics or refresh expired customer tokens:
| Event | When it fires | Payload |
|---|---|---|
ready | Script initialized and window.Kinro is available | {} |
opened | Popup modal opened | { placement } |
closed | Popup modal closed (button, backdrop, Escape, or Kinro.close()) | { placement } |
application_started | Customer began interacting with the form | { placement, display } |
application_submitted | Customer submitted a step's answers | { placement, display } |
quote_ready | Live carrier quote cards rendered in the widget | { placement, display } |
portal_opened | Customer clicked a quote's checkout button to open Kinro checkout | { placement, display, quoteId? } |
error | Invalid partner ID, expired/invalid customer token, or network error | { code, placement?, display? } |
display is "popup" or "inline".
The error event's code is one of:
| Code | Meaning | What to do |
|---|---|---|
unknown_partner | data-partner is not a valid partner ID. The widget does not start. | Copy the partner ID from your Kinro contact exactly. |
unauthorized | Kinro refused the request: your partner is not activated yet, this page's origin is not registered, or a live token was sent from a local page. | Before activation, open the widget with a customer_token. Otherwise ask Kinro to register the origin. |
invalid_customer_token | The customer_token is malformed or unknown. | Mint a fresh token on your server and remount. |
session_expired | The customer's session expired. | Mint a fresh token on your server and remount. |
unavailable | Kinro could not be reached or returned a server error. | The widget lets the customer retry. Report repeated errors to Kinro. |
Handling expired customer tokens
If a customer's kct_* token has expired when they open the widget, embed.js falls back gracefully and emits an error event with code: "invalid_customer_token" or code: "session_expired". Fetch a fresh token from your backend and remount or reopen:
window.Kinro.on("error", async (event) => {
if (
event.code === "invalid_customer_token" ||
event.code === "session_expired"
) {
const { customer_token } = await fetch("/api/kinro-token").then((r) =>
r.json(),
);
window.Kinro.mount(slotElement, { customerToken: customer_token });
}
});5. Skip questions your app already knows
Optional. If your customers are signed in to your platform, send what you know about their business from your server, and the widget opens with it filled in. Send anything you have, even one or two fields. Kinro asks the customer for the rest.
- From your server, call
upsert_leadwith yourexternal_idfor the customer, whateverdatayou have, andmint_customer_token: true. - Pass the returned
customer_token(kct_*) towindow.Kinro.mount(el, { customerToken })orwindow.Kinro.open({ customerToken }). - Keep the token in memory only. Never put a
customer_tokenin a URL, a cookie orlocalStorage.
See Prefill for example payloads, every recognized field, updates, documents and consent.
6. Checkout flow
Quote cards render directly inside your embedded widget with carrier names, pricing, and proposal PDFs. When the customer clicks Continue to checkout, Kinro opens the quote checkout page in a new tab and emits portal_opened.
7. Content Security Policy (CSP)
If your site enforces a strict Content-Security-Policy, allow Kinro's script and API origins and pass your page's style nonce via data-nonce:
Content-Security-Policy:
script-src 'self' https://kinro.com;
connect-src 'self' https://api.kinro.com;
style-src 'self' 'nonce-YOUR_PAGE_NONCE';<script
src="https://kinro.com/partners/embed.js"
data-partner="YOUR_PARTNER_ID"
data-nonce="YOUR_PAGE_NONCE"
defer
></script>If you test against Kinro's preview endpoint, also allow https://api-preview.kinro.com/mcp in connect-src.
8. Develop locally
You can build and test the integration on your own machine before you register any site. A local page only ever creates sandbox test leads:
- Local pages work without registration. The widget runs on
http://localhostandhttp://127.0.0.1, on any port, with your partner ID. Use plainhttp:https://localhostis treated like any other site and must be registered. - The anonymous widget runs in the sandbox there. A visitor who opens the widget on a local page without a
customer_tokencreates a test lead, before and after your partner is activated. - Use your
testtoken. Mint customer tokens with yourtesttoken. Alivetoken sent from a local page is refused with403. Your server sends no browser origin, so a local server process using thelivetoken would create live leads: keep thelivetoken out of local development. - Webhooks still need a public HTTPS URL. Kinro cannot reach your machine directly: expose your local server with a tunnel and register the tunnel's
https://URL as yourtestwebhook.
To test against the preview endpoint, add data-mcp-url; see Sandbox & go-live.