Web SDK Reference
Below are the public functions exposed on the Kolla Web SDK, Kolla.js. They are accessible at `window.kolla`.
This is required before using the other SDK functions and API requests. For details on getting the consumer token, see Installing Konnect.
This will launch the Integration Marketplace in a modal on your website.
This will close the Integration Marketplace modal on your website.
This will launch the integration marketplace directly to a connector details page instead of starting at the marketplace list page.
Use this function to subscribe to events. These events are scoped only to the current session for the current user/consumer.
Event Type | Usage .subscribe("[event_title]", fn) |
---|---|
Link Created | "onLinkCreated" |
Link Disabled | "onLinkDisabled" |
Marketplace Opened | "onMarketplaceOpened" |
Marketplace Closed | "onMarketplaceClosed" |
This gets the consumer information from the consumer token and also returns all the linked accounts for the authenticated consumer.
kolla.getConsumer();
// Response
{
authenticated: true,
user_id: "xyz", // The user ID you specified when generating the consumer_token
user_email: "[email protected]",
organization_name: "My Customers Org", // Optionally set when generating token
organization_id: "23242422asfkjalsk", // Optionally set when generating token
connectors: { // List of all linked accounts
"slack-1": {
status: "ACTIVE"
},
"hubspot-2": {
status: "NEEDS_REAUTH"
}
}
}
Get a list of all your connectors with logos and background color. Use this endpoint to create your own connector list page.
Web SDK
kolla.getConnectors();
// Response
{
connectors: [
{
type: 'salesforce',
display_name: 'Salesforce',
connector_id: 'salesforce-1',
background_color: '#057ACF',
icon: 'https://cdn.getkolla.com/public/connectors/salesforce.svg'
},
{
type: 'hubspot',
display_name: 'Hubspot',
connector_id: 'hubspot-2',
background_color: '#F67600',
icon: 'https://cdn.getkolla.com/public/connectors/hubspot.svg'
},
{
type: 'slack',
display_name: 'Slack',
connector_id: 'slack',
background_color: '#4A154B',
icon: 'https://cdn.getkolla.com/public/connectors/slack.svg'
}
]
}