This will trigger the authentication process for the given connector immediately without showing the embedded marketplace. This is for OAuth connectors only.
If you pass the optional redirectURL, after authentication is finished it will redirect to that URL. If this isn't set it will redirect to the URL that it was on when the function was called.
.subscribe(eventName: string, handler: Function)
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"
.getConsumer()
This gets the consumer information from the consumer token and also returns all the linked accounts for the authenticated consumer.
.getConnectors()
Get a list of all your connectors with logos and background color. Use this endpoint to create your own connector list page.
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"
}
}
}