Skip to content

Website widget

The widget opens the Credify quote flow on your own website.

Your partner ID, with these snippets already filled in, is in the partner portal under Integrations.

For any site, including WordPress, Wix and Squarespace. The script carries everything it needs, including React and its styles.

<script src="https://widget.getcredify.com/index.umd.js"></script>
<script>
CredifyInsuranceWidget.init({
partner: { id: 'cp_live_your_partner_id' }
});
</script>
<button onclick="CredifyInsuranceWidget.open()">Get a quote</button>

For sites built with React 18 or 19. The widget uses your site’s React.

Terminal window
npm install @getcredify/credify-insurance-widget
import { CredifyInsuranceWidget } from '@getcredify/credify-insurance-widget';
CredifyInsuranceWidget.init({
partner: { id: 'cp_live_your_partner_id' }
});
export function QuoteButton() {
return <button onClick={() => CredifyInsuranceWidget.open()}>Get a quote</button>;
}

The widget injects its own styles.

Your partner ID (cp_live_…) names your firm and nothing else. It can’t submit or read anything, so it is safe in your page source.

Never put a secret key (sk_…) in the widget. Secret keys are for the Intake API on your server. The widget refuses anything that is not a cp_ ID.

A malformed ID is ignored with a console warning and the quote continues uncredited, so check the browser console after wiring it up.

CredifyInsuranceWidget.init({
partner: { id: 'cp_live_your_partner_id', sub: 'homepage-hero' },
product: 'Auto',
prefill: { zip: '78701', email: 'maria.gomez@example.com', phone: '1234567890' },
autoOpen: false
});
Option Meaning
partner.id Your public partner ID.
partner.sub A label for this page or campaign, shown in your reporting. Lowercased to letters, digits, - and _; at most 100 characters.
product Home (the default), Auto or Bundle. A ?credify_product=auto link parameter overrides it for that visit.
prefill Contact details your page already collected. Each value the flow can use skips its question; one it can’t use is ignored. A visitor resuming a saved quote keeps their own answers.
autoOpen true opens the widget as soon as it loads.

Methods: open(), close() and destroy().

Set your logo and brand color in the partner portal under Settings → Partner profile. Every embed carrying your partner ID picks them up within about five minutes, with nothing to change in your snippet.

Forward funnel events to your own analytics. Register listeners before calling init.

CredifyInsuranceWidget.on('stageCompleted', (data, meta) => {
analytics.track('insurance_step', { step: data.stageKey, quoteId: meta.quoteId });
});
Event Payload Fires when
widgetOpened none The widget opens.
widgetClosed none The widget closes.
stageViewed { stageKey, stageTitle, stepIndex, totalSteps } A step becomes visible.
stageCompleted { stageKey, stageTitle, stepIndex, totalSteps } A step is completed.
flowCompleted none Every step is done and rates are being generated.
ratesViewed { rateCount } The rates screen is shown.
ratesBack none The visitor goes back from the rates screen.
submissionFailed { reason: 'submission' | 'timeout' | 'network' } A quote submission fails.

Every callback also receives meta: { quoteId, timestamp }. quoteId is null until the quote exists.

The package README on npm covers iframe embedding, full-page mode and the TypeScript types.