Include the Canopy Connect initialization script on your site. It should always be loaded
directly from, rather than hosted yourself.

<script src=""></script>


const handler = CanopyConnect.create({
  // [Optional string] to skip the first screen in the widget, you can supply a consent token. See the “Usage with Consent API” section for more details.
  publicAlias: "<YOUR_WIDGET_PUBLIC_ALIAS>",
  onAuthenticationSuccess: (data) => {
    // [Optional callback] called when user is authenticated
  onExit: (err, data) => {
    // [Optional callback] called when user exits flow (including after authenticating successfully)
  onDestroy: () => {
    // [Optional callback] called when you use the `handler.destroy()` method below
  onSelectCustomInsuranceProvider: ({ providerName }) => {
    // [Optional callback] called when user selects a custom insurer on a link that has the custom insurer button enabled
  pullMetaData: {
    // arbitrary JSON-serializable data to set as Pull.meta_data
});; // show Canopy Connect modal
handler.close(); // close Canopy Connect modal
handler.destroy(); // destroy Canopy Connect modal (optional - removes all DOM elements and event listeners)