Authentic
AuthenticContact
  • Authentic 101
    • About Authentic
    • Company Background
    • Customer Reviews
    • How Authentic Works
      • Captive Insurance
      • Business Owner's Policy
      • Coverage Options
      • Our Partner Appetite
        • Exclusions
        • Endorsements
  • Embedding Insurance
    • Integration Overview
    • Add Insurance to Your Platform
      • Embed our widget
        • Accessing Event Data through Webhooks
      • Different endpoints & functionality within our widget
        • Instant Estimate (/estimate)
        • Welcome Page (/welcome)
        • Direct to Lead Form (/apply)
        • Policy Hub (/policy)
    • Data Share
      • Data Sharing via Widget
      • Data Sharing via URL
      • Commonly Prefilled Questions
      • SMB Class Codes
      • Data Capture (Easy Webhook Set Up)
      • Sample Webhook Events
    • Authentic User Verification Offering(s)
    • Custom Insurance Domain
    • Tracking Marketing (UTM Params)
  • Go To Market
    • Go To Market for SaaS Partners
      • Create Access Points
      • Buying Triggers
      • Prequote Marketing Emails
        • Authentic-Led Prequote Campaigns
        • Tenant-Led Prequote Campaigns
        • URL Prefill Instructions
    • Brand Assets + Marketing Templates
    • Generating Estimate Links
  • More Reading
    • Learn More about Authentic!
    • Why Authentic?
  • Support
    • FAQs
Powered by GitBook
On this page
Export as PDF
  1. Embedding Insurance
  2. Add Insurance to Your Platform

Embed our widget

How to embed the plug and play embedded widget for Authentic Insurance partners.

PreviousAdd Insurance to Your PlatformNextAccessing Event Data through Webhooks

Last updated 3 months ago

Installation

Add the following script tag to the <head> of your index.html file.

<script type='module' src='https://www.unpkg.com/@authenticins/widget@latest/dist/authenticWidget.js'></script>

To view the source code go here:

Usage

Once installed, the widget script will expose controls to the browser window. You can configure the widget's look and behavior on initialization (see the full WidgetConfig definition below).

<script>
  window.addEventListener('load', () => {
    window.authenticWidget.init({
      insurancePortal: { url: 'https://example-tenant-name.prod.authenticinsurance.com' },
      prefillData: {
        lead: { email: 'johndoe@email.com' }
      },
      themeOverrides: {
        primaryColor: '#000000',
        borderRadiusPx: 6,
        brand: {
          name: 'Example Tenant Name',
          logoUrls: {
            darkBg: 'https://example-tenant-website.com/logo-white.png',
            lightBg: 'https://example-tenant-website.com/logo-black.png'
          },
          faviconUrl: 'https://example-tenant-website.com/favicon.ico'
        }
      }
    });
  })
</script>

Configuration

interface WidgetConfig {
  insurancePortal?: {
    url?: string;
    // The CSS selector for the target element you want the Insurance Portal injected into.
    // If no target selector is provided, the widget will inject its default persistent banner and modal.
    targetSelector?: string;
  };
  customerId?: string;
  prefillData?: {
    lead?: {
      email:? string;
      businessClassCode?: string;
      stateCodes?: string[];
      productIds?: string[];
    };
    responses?: {
      exposures?: Array<{
        exposureName: string;
        // Where each key is a field's name mapped to its value (e.g. ['BUSINESS_LEGAL_NAME']: 'Example Business Name');
        fieldValues: Record<string, string>;
      }>;
      // Same as format described above.
      questions?: Record<string, string>;
    };
  };
  themeOverrides?: {
    useDarkMode?: boolean;
    primaryColor?: string;
    secondaryColor?: string;
    borderRadiusPx?: number;
    brand?: {
      name?: string;
      logoUrls?: {
        darkBg?: string;
        lightBg?: string;
      };
      faviconUrl?: string;
    };
  };
};
https://www.npmjs.com/package/@authenticins/widget?activeTab=readme