Reference Documentation

CanopyConnect

.create(options)

Returns a Handler

Creates a SDK Handler instance for your link.

Kind: static method of CanopyConnect

ParamTypeDescription
optionsObjectSDK Handler options.
options.publicAliasStringThe public alias of the link you would like to use. Each link has a unique public alias. You can view all your links on the Links Page. The public alias is what follows after the /c/in your link's url. Example: the public alias for https://app.usecanopy.com/c/demois demo.
options.modalBooleanDefault=true. Whether Canopy Connect should be in a modal. If false, options.mount will be used
options.mountString/Element/nullCan be used when options.modal=false, this specifies where Canopy Connect should be mounted to and will mount there immediately when .create() is called. Alternatively you can use .mount() to mount after .create() is called.
[options.pullMetaData]ObjectArbitrary JSON-serializable data. The API returns this data in Pull.meta_data
[options.consentToken]StringA token retrieved by pre-collecting consent to skip the first screen in the widget. Reference the Consent API for more information.
[options.reconnectToken]StringWhen dropping the user into the Monitoring reconnect flow provide a reconnectToken instead of consentToken. See How to use Monitoring.
[options.onAuthenticationSuccess]CallbackTriggered when the user successfully authenticates with their insurance provider. Reference the 'authenticationSuccess' event for data parameters.
[options.onSectionViewed]CallbackTriggered when the user views a section. Will trigger when viewed again. Reference the sectionViewed event for parameters.
[options.onUserAction]CallbackTriggered when user completes certain actions. Reference the onUserAction event for parameters.
[options.onSelectCustomInsuranceProvider]CallbackTriggered when the user selects "Provide policy manually" while searching for their carrier. Contact [email protected] to enable this feature. Reference the 'selectCustomInsuranceProvider' event for data parameters.
[options.onExit]CallbackTriggered when the user exits the Canopy Connect SDK modal. Reference the 'exit' event for data parameters.
[options.onError]CallbackTriggered on non-terminal errors.
[options.onDestroy]CallbackTriggered when the Handler is destroyed after Handler.destroy() is called.

Handler

Instance of EventEmitter

.close()

Closes the Canopy Connect SDK modal.

Kind: instance method of Handler

.destroy()

Removes the SDK from the application and triggers the destroy event.

Kind: instance method of Handler

.mount(selectorOrElement)

Can be used when options.modal=false. Mounts the SDK directly to the selector or Element.

Kind: instance method of Handler

.on('authenticationSuccess')

Triggered when the user successfully authenticates with their insurance provider.

Kind: instance method of EventEmitter

ParamTypeDescription
dataObjectEvent data.
data.pullObjectThe resulting Pull that was successfully authenticated.
data.pull.pull_idStringThe ID of the Pull, use this to wait for the Pull's webhooks.
data.pull.metadataObject/nullThe metadata of the Pull, will match what was passed in via pullMetaData and/or cc-meta params.

.on('sectionViewed')

Triggered when a section is viewed. Triggers again if section is viewed again.

Kind: instance method of EventEmitter

ParamTypeDescription
dataObject
[data.section]StringPossible values: INTRO, LOGIN, SUCCESS, DRIVERS, CONTACT_INFO, SELECT_POLICIES, DEMOGRAPHICS, CUSTOM, TEXT_DISPLAY, VEHICLES, DWELLING, INSURANCE_TYPES, INSURER_LIST, LOGIN_MFA_OPTIONS, LOGIN_MFA_CREDS, LOGIN_SUBMITTING_CREDS

.on('userAction')

Triggered when user completes certain actions.

ParamTypeDescription
actionDataObjectData associated with this user action
[actionData.action]StringType of action taken. Possible values: CONSENT_SUBMITTED, CREDS_SUBMITTED, MFA_SUBMITTED, INSURER_SELECTED
[actionData.data]ObjectAdditional data about the action taken. Currently only sends insurance_provider_name when action is INSURER_SELECTED.

.on('destroy')

Triggered when the Handler is destroyed after Handler.destroy() is called.

Kind: instance method of EventEmitter

.on('exit')

Triggered when the user exits the Canopy Connect SDK modal.

Example: handler.on('exit', (err: any, data: any) => {});

Kind: instance method of EventEmitter

ParamTypeDescription
errObject/nullExists if the user exited before successfully authenticating. Contains a error_code which is the step the user exited on.
[err.error_code]StringPossible values: NOT_AUTHENTICATED, INTERNAL_ERROR, PROVIDER_ERROR, INSUFFICIENT_CREDENTIALS, IDENTITY_VERIFICATION_OPTIONS, IDENTITY_VERIFICATION
dataObject/nullExists if the user consented and created a pull.
[data.pull]ObjectThe Pull that was created. If no data.err exists, this Pull was successfully authenticated.
[data.pull_id]StringThe ID of the Pull that was created.
[data.metadata]Object/nullThe metadata of the Pull, will match what was passed in via pullMetaData and/or cc-meta params.

.on('selectCustomInsuranceProvider')

Triggered when the user selects "Provide policy manually" while searching for their carrier. Contact [email protected] to enable this feature.

Kind: instance method of EventEmitter

ParamTypeDescription
dataObjectEvent data.
data.providerNameStringInsurance provider name entered by the user when they clicked "Provide policy manually"

.open()

Opens the Canopy Connect SDK modal.

Kind: instance method of Handler