npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

leadconduit-integration-ui

v1.1.5

Published

LeadConduit Integration UI Helper

Downloads

749

Readme

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:

| Parameter | Description | Availability | | -- | -- | -- | | entity | Information about the particular entity that this integration is from, including { name, id }. | Always | | accountInfo | Object with { id, name, ssoId } referring to the current account using the app | Always | | integration | An ID referencing the particular integration being used from the selected integration package | Sometimes | | credential | A credential object that contains { token } if available and selected | Sometimes | | flow | Limited 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 | | router | If the integration has a specific router, that information is provided here | Sometimes |

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.