3.0.7 • Published 24 days ago

@authenticins/widget v3.0.7

Weekly downloads
-
License
-
Repository
github
Last release
24 days ago

Authentic Widget

A plug and play embedded widget for Authentic's Insurance Portal.

Installation

npm install @authenticins/widget

Or

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

Usage

authenticWidget.init();

Configuration

When calling the init() method, you can optionally pass a configuration object to customize the look and behavior of the widget. You can also application pre-fill data on behalf of your end user (see the full WidgetConfig interface definition below).

authenticWidget.init({
  insurancePortal: {
    url: 'https://tenant-name.prod.authenticinsurance.com',
    targetSelector: '#authentic-insurance-portal'
  },
  prefillData: {
    meta: {
      email: 'user@email.com',
      stateCodes: ['OH']
    }
  },
  themeOverrides: {
    primaryColor: '#000000',
    borderRadius: 6,
    brand: {
      name: 'Example Tenant Name',
      logoUrls: {
        light: 'https://example-tenant-website.com/logo-white.png',
        dark: 'https://example-tenant-website.com/logo.png',
      },
      faviconUrl: 'https://example-tenant-website.com/favicon.ico'
    }
  }
});
interface WidgetConfig {
  insurancePortal?: {
    url?: string;
    // The CSS selector for the element you want the Insurance Portal injected into.
    targetSelector?: string;
    funnelFlow?: 'lead-form' | 'welcome';
  }
  prefillData?: {
    meta?: {
      email?: string;
      businessClassCode?: string;
      stateCodes?: string[];
      productIds?: string[];
    }
    answers?: {
      // Where each key is a field's name, mapped to its value (e.g. { 'BUSINESS_LEGAL_NAME': 'Example Business' });
      questions?: Record<string, string>;
      exposures?: Array<{
        id: string;
        exposureName: string;
        // Same format as described above.
        fieldValues: Record<string, string>;
      }>;
    }
  }
  themeOverrides?: {
    useDarkMode?: boolean,
    primaryColor?: string;
    borderRadius?: number;
    brand?: {
      name?: string;
      logoUrls?: {
        light?: string;
        dark?: string;
      }
      faviconUrl?: string;
    }
    layout?: {
      hideNavbar?: boolean;
      hideFooter?: boolean;
    };
  }
}

Reactive usage

If using a framework such as React, utilize the init and destroy methods between renders.

function App({ prefillData }) {
  useEffect(() => {
    authenticWidget.init({ prefillData });
    return () => { authenticWidget.destroy(); }
  }, [prefillData]);
}
3.0.7

24 days ago

3.0.4

26 days ago

3.0.6

25 days ago

3.0.5

26 days ago

3.0.3

2 months ago

3.0.2

2 months ago

3.0.1

2 months ago

3.0.0

2 months ago

2.2.20

4 months ago

2.2.19

4 months ago

2.2.17

4 months ago

2.2.18

4 months ago

2.2.15

4 months ago

2.2.16

4 months ago

2.2.13

4 months ago

2.2.14

4 months ago

2.2.12

4 months ago

2.2.11

5 months ago

2.2.10

5 months ago

2.2.9

5 months ago

2.2.8

5 months ago

2.2.7

5 months ago

2.2.1

6 months ago

2.2.0

6 months ago

2.2.3

6 months ago

2.2.2

6 months ago

2.2.5

6 months ago

2.2.4

6 months ago

2.2.6

6 months ago

2.1.9

6 months ago

2.1.8

6 months ago

2.1.7

6 months ago

2.1.6

6 months ago

2.1.5

6 months ago

2.1.4

6 months ago

2.1.3

6 months ago

2.1.2

6 months ago

2.1.1

6 months ago

2.1.0

6 months ago

2.0.2

7 months ago

2.0.1

7 months ago

2.0.0

7 months ago

1.4.1

7 months ago

1.4.0

7 months ago

1.3.9

7 months ago

1.3.8

7 months ago

1.3.7

7 months ago

1.3.6

7 months ago

1.3.5

7 months ago

1.3.4

7 months ago

1.3.3

7 months ago

1.3.2

7 months ago

1.3.1

7 months ago

1.3.0

7 months ago

1.2.9

7 months ago

1.2.8

7 months ago

1.2.7

7 months ago

1.2.6

7 months ago

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

7 months ago

1.2.2

7 months ago

1.2.1

7 months ago

1.2.0

7 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago