Widget and embed
The embeddable quoter: one script tag on any website, with branding, prefill and events. This is the general reference; each product has its own snippet in its distribution settings.
Basic snippet
- Always use a publishable key (
pk_…).data-channelpicks the channel:public(end customer) orintermediary. - With an intermediary key the widget always operates as that intermediary.
- Each channel is enabled per product (public widget and intermediary widget).
HTML
<script src="/widget/v1/embed.js" data-product-id="PRODUCT_ID" data-api-key="pk_live_…" data-channel="public" async ></script>
Events
The widget tells your page about every quote, policy and payment: listen to the events on the script tag, or use onQuote, onPolicy and onPayment with the JS API.
Listen to events
const el = document.querySelector('script[src*="embed.js"]');
el.addEventListener('quore:quote', (e) => console.log(e.detail));
el.addEventListener('quore:policy', (e) => console.log(e.detail));
el.addEventListener('quore:payment', (e) => console.log(e.detail));Payload (e.detail)
// quore:quote
{ quoteId, coverages, … }
// quore:policy
{ id, policyNumber, status, payment? }
// quore:payment
{ policyId, policyStatus, paymentMethodStatus, settling }quore:quote: every priced quote.quore:policy: the issued policy, withpaymentwhen the charge continues online.quore:payment: the outcome of a payment or a payment method registration inside the widget.
Signed embed (the insurer own portal)
- To embed the intermediary widget inside your own portal, with the intermediary already identified.
- Your server signs
intermediaryRef.timestamp.nonce(with a random nonce per page load) using HMAC-SHA256 and your account's embed signing secret, and renders the tag with the signature and the nonce. - The signature is valid for 5 minutes and a single use; the widget exchanges it for a 15-minute session that refreshes itself.
- Use your account publishable key, not an intermediary key.
How it works: the intermediary is already signed in to your portal, so they never sign in to Quore again.
- Your server, which already knows who is signed in, signs
intermediaryRef.timestamp.nonceand renders the widget tag with that signature and the nonce. - The widget sends the signature to
POST /api/embed/sessions. Quore checks the signature, its validity window and that it was never used before, then looks up the intermediary by their external reference. - Quore returns a 15-minute session that refreshes itself. The intermediary quotes and issues with their own view, products and commission.
What your team builds and what Quore handles:
- Your team: sign on your server (a few lines, with samples below) and load each intermediary’s external reference in Quore, which must be the same ID your portal uses. The signing secret must never reach the browser.
- Quore: verify the signature, create and refresh the session, enforce the hierarchy and permissions, quote, issue and collect payment.
Acting on behalf of a sub-producer: a higher-level intermediary can work as someone in their structure.
- To open the widget already acting as a sub-producer, send their external reference in
data-acting-as-ref. - The intermediary can also choose whom they represent from inside the widget.
- They can only choose intermediaries below them in the hierarchy, and Quore checks it again on every request. The session always has intermediary permissions, never administrator ones, even if the user is also an administrator.
- The quote and the policy belong to the represented intermediary and are priced with their commission. Quore also stores who actually operated (
actorUserId) and records every session start in the audit log.
Tag
<!-- data-acting-as-ref (optional): reference of the sub-producer to preselect --> <!-- data-quote-id (optional): reopens that saved quote directly at issuance --> <script src="/widget/v1/embed.js" data-api-key="pk_live_..." data-product-id="PRODUCT_ID" data-intermediary-ref="<%= intermediaryRef %>" data-timestamp="<%= ts %>" data-signature="<%= sig %>" data-nonce="<%= nonce %>" data-acting-as-ref="" data-quote-id="" async ></script>
Signature on your server
const crypto = require('crypto');
const ts = Math.floor(Date.now() / 1000);
const nonce = crypto.randomBytes(16).toString('hex');
const sig = crypto.createHmac('sha256', process.env.QUORE_EMBED_SECRET).update(`${intermediaryRef}.${ts}.${nonce}`).digest('hex');Full reference
Attributes, branding, prefill, JS API, payments and security. The fields you can prefill depend on each product.
- data-variables (or variables in the JS API) is a JSON object with the product's variable keys. Prefilled values can be edited, except those listed in data-readonly-variables.
- Types: numbers as a number or text ("20000000" or "20.000.000"); currency with or without "$"; booleans true/false (also "si"/"no", 1/0); ISO dates YYYY-MM-DD; options by their exact value (case-insensitive).
- An invalid value (out of range, unknown option, wrong type) is not loaded: the field shows the error and keeps its default value. It never breaks the widget.
- Keys that are not product variables are ignored with a warning in the browser console.
- Issuance field keys (for example email or CUIT) are filled in at the issuance step.
- data-holder fills the policyholder's contact data into the matching issuance fields (name or company name, email, phone, DNI/CUIT, address). data-variables takes precedence over data-holder.
- data-readonly-variables='["key"]' locks those fields (only if they arrived with a valid value).
- With data-autoquote="true", if every visible quoting field arrived prefilled and valid, the widget shows the results directly; if any is missing or invalid, it opens that field's step.
Visibility by role (Variables → Visibility)
- Visible — shown and can be prefilled.
- Prefilled — not shown; the product sets the value and the embed cannot change it.
- Hidden — not shown and the embed cannot set it: from a publishable key the backend ignores values sent for variables hidden from the client (for example discounts or internal sums).