CanopyConnect
.create(options)
Returns a Handler
Creates a SDK Handler instance for your link.
Kind: static method of CanopyConnect
Param | Type | Description |
---|---|---|
options | Object | SDK Handler options. |
options.publicAlias | String | The 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/demo is demo . |
options.modal | Boolean | Default=true. Whether Canopy Connect should be in a modal. If false , options.mount will be used |
options.mount | String | Element | null | Can 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] | Object | Arbitrary JSON-serializable data. The API returns this data in Pull.meta_data |
[options.consentToken] | String | A token retrieved by pre-collecting consent to skip the first screen in the widget. Reference the Consent API for more information. |
[options.reconnectToken] | String | When dropping the user into the Monitoring reconnect flow provide a reconnectToken instead of consentToken . See How to use Monitoring. |
[options.onAuthenticationSuccess] | Callback | Triggered when the user successfully authenticates with their insurance provider. Reference the 'authenticationSuccess' event for data parameters. |
[options.onSelectCustomInsuranceProvider] | Callback | Triggered 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] | Callback | Triggered when the user exits the Canopy Connect SDK modal. Reference the 'exit' event for data parameters. |
[options.onDestroy] | Callback | Triggered 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
Param | Type | Description |
---|---|---|
data | Object | Event data. |
data.pull | Object | The resulting Pull that was successfully authenticated. |
data.pull.pull_id | String | The ID of the Pull, use this to wait for the Pull's webhooks. |
data.pull.metadata | Object | null | The 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
Param | Type | Description |
---|---|---|
data | Object | Event data. |
data.err | Object | null | Exists if the user exited before successfully authenticating. Contains a error_code which is the step the user exited on. |
[data.err.error_code] | String | Possible values: NOT_AUTHENTICATED , INTERNAL_ERROR , PROVIDER_ERROR , INSUFFICIENT_CREDENTIALS , IDENTITY_VERIFICATION_OPTIONS , IDENTITY_VERIFICATION |
data.data | Object | null | Exists if the user consented and created a pull. |
[data.data.pull] | Object | The Pull that was created. If no data.err exists, this Pull was successfully authenticated. |
[data.data.pull_id] | String | The ID of the Pull that was created. |
[data.data.metadata] | Object | null | The 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
Param | Type | Description |
---|---|---|
data | Object | Event data. |
data.providerName | String | Insurance provider name entered by the user when they clicked "Provide policy manually" |
.open()
Opens the Canopy Connect SDK modal.
Kind: instance method of Handler