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.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.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('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.

Kind: instance method of EventEmitter

ParamTypeDescription
dataObjectEvent data.
data.errObject | nullExists if the user exited before successfully authenticating. Contains a error_code which is the step the user exited on.
[data.err.error_code]StringPossible values: NOT_AUTHENTICATED, INTERNAL_ERROR, PROVIDER_ERROR, INSUFFICIENT_CREDENTIALS, IDENTITY_VERIFICATION_OPTIONS, IDENTITY_VERIFICATION
data.dataObject | nullExists if the user consented and created a pull.
[data.data.pull]ObjectThe Pull that was created. If no data.err exists, this Pull was successfully authenticated.
[data.data.pull_id]StringThe ID of the Pull that was created.
[data.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