1.1.5 • Published 2 years ago

leadconduit-integration-ui v1.1.5

Weekly downloads
429
License
ISC
Repository
github
Last release
2 years ago

leadconduit-integration-ui

LeadConduit Integration UI Helpers

Usage

The function ui.init() is called with a function that is given data from the LeadConduit client app pertaining to the particular user/account and integration. When this function is called, it waits until the document is fully loaded, then extracts styles from the parent frame and injects them into the current iframe, then sends a signal to the client that the integration is ready to be rendered.

var ui = require('leadconduit-integration-ui');

ui.init(/* optional */data, function(config) {
  // the config argument contains data like entity, mappings and creds
  
  // (this is where angular bootstrapping should happen)
  
  // if you need to navigate to a relative path, this method provides 
  // a safe way to get where you need to go
  var myResourcePath = ui.getBasePath('/path/to/resource');
  
  // the following methods help with interacting with the parent:
  
  // cancel whatever the user was doing and close the modal
  ui.cancel();
  
  // create something and add it to the flow, then close
  ui.create({
    flow: {
      steps: [/* step data goes here */]
    }
  });
});

If the optional data object is provided, the data will be passed directly to the client for use during initial setup. The url parameter will be sent automatically containing the current window's location href. Currently, this object is only used for the url parameter.

config object

The config object is provided to the function passed to ui.init(). It can contain a varying number of parameters:

ParameterDescriptionAvailability
entityInformation about the particular entity that this integration is from, including { name, id }.Always
accountInfoObject with { id, name, ssoId } referring to the current account using the appAlways
integrationAn ID referencing the particular integration being used from the selected integration packageSometimes
credentialA credential object that contains { token } if available and selectedSometimes
flowLimited information about the flow this integration is used in, if available. It may contain only { id }, or it may additionally contain { fields } if the package is a LeadConduit integration.Sometimes
routerIf the integration has a specific router, that information is provided hereSometimes

ui actions

The client will respond to certain "actions" that the integration fires.

ui.create

This creates a new step in the user's flow. The structure of the data object provided as a first argument should look like this:

{ 
  flow: {
    fields: ['fields', 'to', 'add'],
    steps: [ /* steps to add */ ]
  },
  credential: {
    token: 'string'
  },
  entities: [{
    /* full entity object needs to be provided, see https://docs.activeprospect.com/leadconduit/reference.html#entity */
  }],
  router: {
    /* full router object needs to be provided, see https://github.com/activeprospect/leadconduit-schema/blob/master/schema.json#L865 */
  }
}
ui.cancel

This closes the UI, behaving similarly to ui.create in that anything provided will be used to set up the flow.

ui.close

This closes the integration, updating the credential if provided. This is considered legacy and shouldn't be used anymore.

1.1.5

2 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.2-rc.3

6 years ago

1.1.2-rc.2

6 years ago

1.1.2-rc.1

6 years ago

1.1.2-rc.0

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-rc.3

7 years ago

1.0.0-rc.2

7 years ago

1.0.0-rc.1

7 years ago

1.0.0-rc.0

7 years ago

0.0.0

7 years ago