### Connect to Salesforce and Query Accounts using Kolla SDK and Node.js Source: https://docs.getkolla.com/kolla/connector-guides/salesforce This code snippet demonstrates the process of authenticating with the Kolla SDK to retrieve a user's Salesforce access token. It then utilizes the 'jsforce' library in Node.js to establish a connection to Salesforce using the obtained token and executes a SOQL query to fetch account records. The example includes basic error handling and shows how to check for pagination. ```Node.js // Use KollaConnect client to get your user's salesforce access token kolla.authenticate(KOLLA_API_KEY) // Get the consumer's auth token to salesforce var clientSalesforceToken = kolla.getToken("salesforce", customerId) var jsforce = require('jsforce'); var conn = new jsforce.Connection({ accessToken: clientSalesforceToken }); var records = []; conn.query("SELECT Id, Name FROM Account", function(err, result) { if (err) { return console.error(err); } console.log("total : " + result.totalSize); console.log("fetched : " + result.records.length); console.log("done ? : " + result.done); if (!result.done) { // you can use the locator to fetch next records set. // Connection#queryMore() console.log("next records URL : " + result.nextRecordsUrl); } }); ``` -------------------------------- ### Create a New Slack Application Source: https://docs.getkolla.com/kolla/connector-guides/slack Steps to initialize a new Slack application from scratch in the Slack Apps dashboard, including naming and initial permission scope selection. ```APIDOC 1. Go to Slack Apps dashboard. 2. Click "Create New App" and select "From Scratch". 3. Name your app (e.g., company name, as it's used for permission requests). 4. Choose the necessary permissions in "OAuth & Permissions" > "Scopes". Note: Permissions can be changed later, but will require connected users to re-connect and approve. ``` -------------------------------- ### Add Configured Slack App to Kolla Admin Portal Source: https://docs.getkolla.com/kolla/connector-guides/slack Guide on how to input the Slack application's credentials (Client ID, Client Secret, Shareable URL) into the Kolla admin portal to complete the integration process. ```APIDOC 1. Retrieve the following information from your Slack App: - Client ID (found in Basic Info) - Client Secret (found in Basic Info) - Shareable URL (found in Manage Distribution) 2. Login to your Kolla admin portal. 3. Navigate to "Connectors". 4. Click on "Add New Connector" and select "Slack" from the list. 5. Input the retrieved Client ID, Client Secret, and Shareable URL into the respective fields. 6. Click "Create" to finalize the integration. ``` -------------------------------- ### Configure Slack App Redirect URL and Distribution Source: https://docs.getkolla.com/kolla/connector-guides/slack Instructions for configuring the Slack application to work with KollaConnect, including setting the OAuth redirect URL, activating public distribution, and enabling advanced token security. ```APIDOC 1. Add the KollaConnect redirect URL to your Slack App: Go to "OAuth & Permissions" > "Redirect URLs" and add: https://connect.getkolla.com/oauth 2. Set your app for public distribution: Go to "Manage Distribution" and click "Activate Public Distribution". 3. Opt in for advanced token security: Go to "OAuth & Permissions" and in the section titled "Advanced token security via token rotation", click "Opt in". ``` -------------------------------- ### Send Slack Message with Kolla-managed Token in Go Source: https://docs.getkolla.com/kolla/tutorials/build-a-slack-integration This Go code snippet demonstrates how to send a message to a Slack channel using an authentication token managed by Kolla. It initializes a Kolla client using an API key from an environment variable, then retrieves a Slack authentication token for a specified connector ID and customer ID. The retrieved token is used to create a Slack API client, which then posts a 'Hello world!' message to the 'general' channel. This example highlights Kolla's role in simplifying OAuth2 token management and refresh processes. ```Go package main import ( "context" "os" "github.com/kollalabs/sdk-go/kc" "github.com/slack-go/slack" ) func main() { // Get api key from environment variable apiKey := os.Getenv("KOLLA_API_KEY") // Create a new client kolla, err := kc.New(apiKey) if err != nil { log.Fatalf("unable to create kolla connect client: %s\n", err) } ctx := context.Background() creds, err := kolla.Credentials(ctx, "slack-10223", "test") if err != nil { panic(err) } //creds.LinkedAccount.AuthData slackapi := slack.New(creds.Token) _, _, err = slackapi.PostMessage("general", slack.MsgOptionText("Hello world! (Sent with Kolla managed token)", false)) if err != nil { panic(err) } } ``` -------------------------------- ### Slack App Manifest for Kolla Integration Source: https://docs.getkolla.com/kolla/tutorials/build-a-slack-integration This JSON manifest defines the basic information, features (like bot user), OAuth configuration (redirect URLs and scopes), and settings for a Slack application intended to be integrated with Kolla. It specifies display information, bot user details, OAuth scopes required for channels and chat, and distribution settings. ```json { "display_information": { "name": "Kolla Example App", "description": "An simple Kolla example app", "background_color": "#da3a79", "long_description": "This is an example app manifest from the Kolla tutorial for creating a Slack integration quickly. Kolla manages all your OAuth2 connections to third parties so you can focus on the important parts of your integrations. See https://getkolla.com for more information." }, "features": { "bot_user": { "display_name": "Kolla", "always_online": true } }, "oauth_config": { "redirect_urls": [ "https://connect.getkolla.com/oauth" ], "scopes": { "bot": [ "channels:read", "chat:write", "chat:write.public" ] } }, "settings": { "org_deploy_enabled": false, "socket_mode_enabled": false, "token_rotation_enabled": true } } ``` -------------------------------- ### Access Heartland Retail API Documentation Source: https://docs.getkolla.com/kolla/connector-guides/heartland-retail Link to the external Heartland Retail API documentation portal for comprehensive API specifications and details. ```APIDOC Check out the Heartland API Docs: https://dev.retail.heartland.us/ ``` -------------------------------- ### Lightspeed Client Application Registration Details Source: https://docs.getkolla.com/kolla/connector-guides/lightspeed-retail-r-series This section specifies the details required for registering a new client application on the Lightspeed developer portal, including the mandatory redirect URI and the output credentials. ```APIDOC Lightspeed Client Registration Form: Endpoint: https://developers.lightspeedhq.com/retail/authentication/scopes/ Required Fields: - Company fields: All required - Redirect URI: https://connect.getkolla.com/oauth Output Parameters: - Client ID: string (unique identifier for your application) - Client Secret: string (secret key for your application) ``` -------------------------------- ### Apply for Zendesk Global OAuth Client Source: https://docs.getkolla.com/kolla/connector-guides/zendesk Instructions for requesting a Global OAuth client through the Zendesk Developer Portal, which is a prerequisite for certain integration capabilities with Kolla. ```APIDOC 1. Login to the Zendesk Developer Portal (https://apps.zendesk.com/). 2. If you haven't already, fill out your information in the Organization section and click save. 3. In the organization section, click on the `Global OAuth Request` tab. 4. Fill out the information including your domain for your Zendesk developer account and your OAuth client Unique Identifier from the previous section. ``` -------------------------------- ### Install Kolla React SDK Source: https://docs.getkolla.com/kolla/developer-resources/web-elements-new This command installs the `@kolla/react-sdk` package, which provides React components and hooks for integrating Kolla functionality into your application. ```bash npm i @kolla/react-sdk ``` -------------------------------- ### Kolla Lightspeed (R) Connector Configuration Source: https://docs.getkolla.com/kolla/connector-guides/lightspeed-retail-r-series This snippet details the configuration parameters needed when adding the Lightspeed (R) connector instance within the Kolla Admin portal, utilizing credentials obtained from Lightspeed client registration. ```APIDOC Kolla Admin Portal - Add Lightspeed (R) Connector: Path: Integrations > Connectors > Add Connector Connector Type: Lightspeed (R) Configuration Parameters: - Client ID: string (obtained from Lightspeed Client Registration) - Client Secret: string (obtained from Lightspeed Client Registration) - Scopes: array of strings (permissions required for integration, reference: https://developers.lightspeedhq.com/retail/authentication/scopes/) ``` -------------------------------- ### Kolla Salesforce Connector Configuration Parameters Source: https://docs.getkolla.com/kolla/connector-guides/salesforce These are the configuration items required when adding the Salesforce connector within the Kolla admin portal. The Consumer ID and Client Secret are obtained from your configured Salesforce Connected App. ```APIDOC Consumer ID: (from Salesforce app setup) Client Secret: (from Salesforce app setup) ``` -------------------------------- ### Accessing HubSpot API with Kolla SDK and Node.js Client Source: https://docs.getkolla.com/kolla/connector-guides/hubspot This snippet demonstrates the process of obtaining a user's HubSpot access token via the Kolla SDK and then using that token to initialize the HubSpot Node.js API client. It shows an example call to the CRM Contacts API's `getPage` method, including how to handle both successful responses and potential errors. ```JavaScript // Use KollaConnect client to get your user's hubspot access token kolla.authenticate(consumerToken) // Get the consumer's auth token to hubspot var clientHubspotToken = kolla.getToken("hubspot", customerId) const hubspot = require('@hubspot/api-client') const hubspotClient = new hubspot.Client({ accessToken: clientHubspotToken }) hubspotClient.crm.contacts.basicApi .getPage(limit, after, properties, propertiesWithHistory, associations, archived) .then((results) => { console.log(results) }) .catch((err) => { console.error(err) }) ``` -------------------------------- ### Slack App Manifest for Kolla Integration Source: https://docs.getkolla.com/kolla/tutorials This JSON manifest defines the basic configuration for a Slack application, including display information, bot user features, OAuth configuration with redirect URLs and scopes, and general settings. It is used to set up a new Slack app in the Slack Developer Portal, providing the necessary details for integration with Kolla. ```JSON { "display_information": { "name": "Kolla Example App", "description": "An simple Kolla example app", "background_color": "#da3a79", "long_description": "This is an example app manifest from the Kolla tutorial for creating a Slack integration quickly. Kolla manages all your OAuth2 connections to third parties so you can focus on the important parts of your integrations. See https://getkolla.com for more information." }, "features": { "bot_user": { "display_name": "Kolla", "always_online": true } }, "oauth_config": { "redirect_urls": [ "https://connect.getkolla.com/oauth" ], "scopes": { "bot": [ "channels:read", "chat:write", "chat:write.public" ] } }, "settings": { "org_deploy_enabled": false, "socket_mode_enabled": false, "token_rotation_enabled": true } } ``` -------------------------------- ### KollaConnect OAuth Redirect URI Source: https://docs.getkolla.com/kolla/connector-guides/google-drive This is the authorized redirect URI that must be added to your Google OAuth 2.0 Client ID configuration. It allows Google to redirect users back to KollaConnect after successful authentication. ```APIDOC https://connect.getkolla.com/oauth ``` -------------------------------- ### Authenticate Kolla Web SDK Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference This function is a prerequisite for utilizing other SDK functionalities and making API requests. It requires a consumer token, which can be obtained by following the 'Installing Konnect' guide. ```APIDOC .authenticate(consumerToken: string) consumerToken: The unique token identifying the consumer. ``` -------------------------------- ### Required OAuth Scopes for Salesforce Integration with KollaConnect Source: https://docs.getkolla.com/kolla/connector-guides/salesforce These are the essential OAuth scopes that must be enabled in your Salesforce Connected App. They grant KollaConnect the necessary permissions to perform operations like refreshing access tokens and managing user data via Salesforce APIs. ```APIDOC Perform requests at any time (refresh_token, offline access) Manage user data via APIs (api) ``` -------------------------------- ### Salesforce OAuth2 Redirect URL for KollaConnect Source: https://docs.getkolla.com/kolla/connector-guides/salesforce The specific OAuth2 redirect URL that must be configured in your Salesforce Connected App settings. This URL allows KollaConnect to securely handle authentication redirects after a user grants access. ```URL https://connect.getkolla.com/oauth ``` -------------------------------- ### Add Zendesk Connector to Kolla Source: https://docs.getkolla.com/kolla/connector-guides/zendesk Steps to integrate your configured Zendesk OAuth client with Kolla's platform, requiring the Client ID and Client Secret obtained from Zendesk for successful connection. ```APIDOC 1. Go to Integrations > Connectors and click Add Connector. 2. Choose Zendesk from the catalog of connectors. 3. Name your instance of this connector and input the following configuration items: - Client ID - Client Secret 4. Press the Save button to finish adding this connector. ``` -------------------------------- ### Configure Zendesk OAuth Client Source: https://docs.getkolla.com/kolla/connector-guides/zendesk Detailed steps to create and configure an OAuth client within your Zendesk Admin Center, including setting the unique identifier, redirect URL, and saving the client secret for Kolla integration. ```APIDOC 1. Go to your Zendesk account Admin Center. 2. Go to `Apps & Integrations` and under the `APIs` section, click on `Zendesk API`. 3. Click on the OAuth Clients tab and click on Add OAuth Client. 4. Fill out the information. Keep in mind for the `Unique identifier` field you need to add a prefix of `zdg-` to make it a global OAuth client. 5. Add the KollaConnect redirect URL: `https://connect.getkolla.com/oauth` to the Redirect URLs section. 6. Click Save and record the client secret to use later in the process. ``` -------------------------------- ### Retrieve Slack Token and Post Message with Kolla Go SDK Source: https://docs.getkolla.com/kolla/getting-started/installing-konnect This Go example demonstrates how to integrate with the Kolla Connect API to obtain a Slack OAuth2 token and then use that token to send a message to a Slack channel. It initializes the Kolla client using an API key from environment variables, fetches credentials for a specified Slack connector and consumer ID, and finally uses the retrieved token with the `slack-go` library to post a message. ```Go package main import ( "context" "os" "github.com/kollalabs/sdk-go/kc" "github.com/slack-go/slack" ) func main() { // Get api key from environment variable apiKey := os.Getenv("KC_API_KEY") // Create a new client kolla, err := kc.New(apiKey) if err != nil { log.Fatalf("unable to create kolla connect client: %s\n", err) } ctx := context.Background() creds, err := kolla.Credentials(ctx, "slack", "CONSUMER_ID") if err != nil { panic(err) } //creds.LinkedAccount.AuthData slackapi := slack.New(creds.Token) _, _, err = slackapi.PostMessage("general", slack.MsgOptionText("Hello world! (Sent with Kolla managed token)", false)) if err != nil { panic(err) } } ``` -------------------------------- ### Send Slack Message with Kolla-Managed Token (Go) Source: https://docs.getkolla.com/kolla/tutorials This Go code snippet demonstrates how to send a message to a Slack channel using a token managed by Kolla. It initializes a Kolla client with an API key, retrieves a Slack authentication token for a specified customer and connector ID, then uses this token to create a Slack API client and post a 'Hello world' message to the 'general' channel. Kolla handles the underlying OAuth2 complexities and token refreshes. ```Go package main import ( "context" os" "github.com/kollalabs/sdk-go/kc" "github.com/slack-go/slack" ) func main() { // Get api key from environment variable apiKey := os.Getenv("KOLLA_API_KEY") // Create a new client kolla, err := kc.New(apiKey) if err != nil { log.Fatalf("unable to create kolla connect client: %s\n", err) } ctx := context.Background() creds, err := kolla.Credentials(ctx, "slack-10223", "test") if err != nil { panic(err) } //creds.LinkedAccount.AuthData slackapi := slack.New(creds.Token) _, _, err = slackapi.PostMessage("general", slack.MsgOptionText("Hello world! (Sent with Kolla managed token)", false)) if err != nil { panic(err) } } ``` -------------------------------- ### Configure Heartland Retail OAuth Redirect URL Source: https://docs.getkolla.com/kolla/connector-guides/heartland-retail Specify this URL as the redirect URL when filling out the Heartland app request form to ensure proper OAuth flow with Kolla. ```URL https://connect.getkolla.com/oauth ``` -------------------------------- ### Get Authenticated Consumer Details and Linked Accounts Source: https://docs.getkolla.com/kolla/developer-resources Retrieves information about the authenticated consumer, including user ID, email, organization details, and a list of all linked accounts with their status. This method relies on the consumer token for authentication. ```JavaScript kolla.getConsumer(); ``` ```JSON { 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" } } } ``` -------------------------------- ### Kolla Konnect OAuth2 Redirect URL Source: https://docs.getkolla.com/kolla/connector-guides This URL is the standard OAuth2 redirect endpoint for Kolla Konnect. It must be provided when registering your integration with Airtable to ensure proper redirection after user authentication. ```Configuration https://connect.getkolla.com/oauth ``` -------------------------------- ### Kolla OAuth Redirect URL for HubSpot Configuration Source: https://docs.getkolla.com/kolla/connector-guides/hubspot This is the specific redirect URL provided by Kolla that must be added to your HubSpot developer app's OAuth settings. It ensures that authentication responses are securely redirected back to the Kolla Konnect platform after a user authorizes the connection. ```Plaintext https://connect.getkolla.com/oauth ``` -------------------------------- ### Include Kolla Web SDK in Frontend Source: https://docs.getkolla.com/kolla/getting-started/installing-konnect Instructions for embedding the Kolla Web SDK into a web application. This is achieved by adding a script tag to the `` section of the HTML, which makes the `kolla` object globally available. ```HTML ``` -------------------------------- ### Open Kolla Integration Marketplace Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference This function launches the Kolla Integration Marketplace within a modal window on your website, allowing users to browse and manage integrations. ```APIDOC .openMarketplace() ``` -------------------------------- ### Open Kolla Integration Marketplace Source: https://docs.getkolla.com/kolla/developer-resources This function initiates and displays the Kolla Integration Marketplace. It opens the marketplace within a modal window directly on your website, allowing users to browse and select integrations. ```APIDOC .openMarketplace() ``` -------------------------------- ### Open Kolla Embedded Marketplace Modal Source: https://docs.getkolla.com/kolla/getting-started/installing-konnect Provides the command to open the Kolla embedded marketplace modal in the frontend. This allows customers to choose and connect integrations. ```JavaScript kolla.openMarketplace(); ``` -------------------------------- ### Authenticate Kolla Web SDK with Consumer Token Source: https://docs.getkolla.com/kolla/getting-started/installing-konnect Shows how to authenticate the Kolla Web SDK on the frontend using the `consumer_token` obtained from the backend. This step is crucial before interacting with the marketplace. ```JavaScript kolla.authenticate("CONSUMER_TOKEN_GOES_HERE") ``` -------------------------------- ### List All Available Connectors (Kolla) Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference Retrieves a comprehensive list of all available connectors, including their display names, IDs, background colors, and icon URLs. This endpoint is useful for building a custom connector selection page. ```JavaScript 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' } ] } ``` -------------------------------- ### Open Specific Kolla Connector Page Source: https://docs.getkolla.com/kolla/developer-resources This function allows direct navigation to a specific connector's details page within the integration marketplace. Instead of displaying the full marketplace list, it immediately opens the page for the specified connector ID. ```APIDOC .openConnector(connectorID: string) connectorID: The unique identifier of the connector to open. ``` -------------------------------- ### Open Specific Kolla Connector Page Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference This function allows direct navigation to a specific connector's details page within the integration marketplace, bypassing the main marketplace list view. ```APIDOC .openConnector(connectorID: string) connectorID: The unique identifier of the connector to open. ``` -------------------------------- ### Retrieve List of All Available Kolla Connectors Source: https://docs.getkolla.com/kolla/developer-resources Fetches a list of all available connectors, including their display name, type, ID, background color, and icon URL. This endpoint is useful for dynamically populating a connector selection page within an application. ```JavaScript kolla.getConnectors(); ``` ```JSON { 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' } ] } ``` -------------------------------- ### Fetch Connector Credentials via Kolla API with cURL Source: https://docs.getkolla.com/kolla/getting-started/installing-konnect This cURL command illustrates how to programmatically request credentials for a specific connector and consumer ID from the Kolla Connect API. It performs a POST request to the `/connect/v1/connectors/CONNECTOR_ID/linkedaccounts/-:credentials` endpoint, requiring `Content-Type`, `Accept`, and `Authorization` headers, along with a JSON body containing the `consumer_id`. ```Curl curl --location --request POST 'https://api.getkolla.com/connect/v1/connectors/CONNECTOR_ID/linkedaccounts/-:credentials' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --data-raw '{ "consumer_id": "YOUR_CUSTOMER_ID" }' ``` -------------------------------- ### Obtain Kolla Consumer Token from Backend Source: https://docs.getkolla.com/kolla/getting-started/installing-konnect Demonstrates how to retrieve a unique `consumer_token` from the Kolla API. This token is essential for authenticating frontend interactions. The process involves making a POST request to the specified endpoint, providing a unique `consumer_id` and an optional `consumer_name`. An API key must be passed as an authorization header. ```APIDOC POST https://api.getkolla.com/connect/v1/consumers:consumerToken Description: Retrieves a unique consumer token for authenticating frontend interactions. Headers: Authorization: Bearer YOUR_API_TOKEN (Required, your Kolla API key) Content-Type: application/json Accept: application/json Body (JSON): consumer_id: string (Required, unique identifier for the customer) metadata: object (Optional, additional customer details) username: string (Optional) email: string (Optional) tenant_id: string (Optional, company ID) tenant_display_name: string (Optional, company name) Returns: string (The consumer_token) ``` ```Go package main import ( "context" "log" "os" "github.com/kollalabs/sdk-go/kc" ) func main() { // Get api key from environment variable apiKey := os.Getenv("KC_API_KEY") if apiKey == "" { log.Fatal("KC_API_KEY not set") } // Create a new client kolla, err := kc.New(apiKey) if err != nil { log.Fatalf("unable to create kolla connect client: %s\n", err) } // Get consumer token ctx := context.Background() consumerToken, err := kolla.ConsumerToken(ctx, "CONSUMER_ID", "CONSUMER_NAME") if err != nil { log.Fatalf("unable to get consumer token: %s\n", err) } log.Printf("ConsumerToken: %s\n", consumerToken) } ``` ```Curl curl --location --request POST 'https://api.getkolla.com/connect/v1/consumers:consumerToken'\ --header 'Content-Type: application/json'\ --header 'Accept: application/json'\ --header 'Authorization: Bearer YOUR_API_TOKEN'\ --data-raw '{ "consumer_id": "YOUR_CUSTOMER_ID", "metadata": { "username": "OptionalUsername", "email": "OptionalEmail", "tenant_id": "OptionalCompanyID", "tenant_display_name": "OptionalCompanyName" } }' ``` -------------------------------- ### Manage Authenticated User with useKollaSDK Hook Source: https://docs.getkolla.com/kolla/developer-resources/web-elements-new This React hook demonstrates how to use `useKollaSDK` to access the Kolla SDK instance and authenticate a user. It utilizes `React.useEffect` to trigger authentication when a `token` is provided and the SDK is available. ```javascript import {useKollaSDK} from "@kolla/react-sdk"; const useAuthToken = ({token}) => { const sdk = useKollaSDK(); React.useEffect(() => { if(token && sdk){ sdk.authenticate(token); } }, [token]); }; ``` -------------------------------- ### Subscribe to Kolla Web SDK Events Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference This function allows you to subscribe to various events emitted by the Kolla Web SDK. Events are scoped to the current user's session. You provide an event name and a handler function to be executed when the event occurs. ```APIDOC .subscribe(eventName: string, handler: Function) eventName: The name of the event to subscribe to. Possible values: "onLinkCreated" "onLinkDisabled" "onMarketplaceOpened" "onMarketplaceClosed" handler: The callback function to execute when the event is triggered. ``` -------------------------------- ### Authenticate Kolla Connector Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference This function initiates the authentication process for a specified connector immediately, without displaying the embedded marketplace. It is exclusively designed for OAuth-based connectors. An optional redirect URL can be provided to control where the user is redirected after authentication; otherwise, they will return to the page where the function was called. ```APIDOC .authConnector(connectorID: string, redirectURL: string[optional]) connectorID: The unique identifier of the connector to authenticate. redirectURL: (Optional) The URL to redirect to after successful authentication. If omitted, redirects to the current page. ``` -------------------------------- ### Subscribe to Kolla Web SDK Events Source: https://docs.getkolla.com/kolla/developer-resources This function enables subscription to various events emitted by the Kolla Web SDK. Events are scoped to the current user's session, allowing developers to react to specific actions or changes within the Kolla integration lifecycle. ```APIDOC .subscribe(eventName: string, handler: Function) eventName: The name of the event to subscribe to. Possible values: "onLinkCreated" "onLinkDisabled" "onMarketplaceOpened" "onMarketplaceClosed" handler: The callback function to execute when the specified event occurs. ``` -------------------------------- ### Integrate Kolla ConnectorButton in React App Source: https://docs.getkolla.com/kolla/developer-resources/web-elements-new This React component demonstrates how to wrap your application with `KollaSDKProvider` to provide context for Kolla UI components, and then render a `ConnectorButton` for a specific `connectorID`. The button facilitates connecting and disconnecting user accounts. ```javascript import { KollaSDKProvider, ConnectorButton, } from "@kolla/react-sdk"; function App() { return ( // This should be placed near the root of your app // This provides context to all of the Kolla UI components // pass in your consumer token as a prop // This renders a connector button and will facilitate connecting and disconnecting for whatever user is associated with the provided consumerToken ); } ``` -------------------------------- ### Retrieve Authenticated Consumer Information (Kolla) Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference Fetches details about the authenticated consumer, including their user ID, email, organization, and a list of all linked accounts with their statuses. This method uses the consumer token for authentication. ```JavaScript kolla.getConsumer(); // Response { authenticated: true, user_id: "xyz", // The user ID you specified when generating the consumer_token user_email: "[email\u00a0protected]", 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" } } } ``` -------------------------------- ### Authenticate Kolla Web SDK with Consumer Token Source: https://docs.getkolla.com/kolla/developer-resources This function is a prerequisite for using other Kolla SDK functions and making API requests. It authenticates the Kolla Web SDK by providing a consumer token, which is essential for secure interaction with the Kolla platform. ```APIDOC .authenticate(consumerToken: string) consumerToken: The unique token identifying the consumer, required for authentication. ``` -------------------------------- ### Kolla ConnectorButton Component API Reference Source: https://docs.getkolla.com/kolla/developer-resources/web-elements-new This API documentation outlines the TypeScript interfaces for customizing the `ConnectorButton` component. It defines `ConnectorButtonStyles` for CSS properties, `ConnectorButtonAttributes` for HTML attributes, and `ConnectorButtonProps` for the component's overall properties, including the required `connectorID`. ```APIDOC export interface ConnectorButtonStyles { button?: CSSProperties; iconContainer?: CSSProperties; icon?: CSSProperties; statusContainer?: CSSProperties; statusText?: CSSProperties; } export interface ConnectorButtonAttributes { button?: ButtonHTMLAttributes; iconContainer?: HTMLAttributes; icon?: ImgHTMLAttributes; statusContainer?: HTMLAttributes; statusText?: HTMLAttributes; } export interface ConnectorButtonProps { connectorID: string; styleOverrides?: ConnectorButtonStyles; attributeOverrides?: ConnectorButtonAttributes; displayTextOverride?: ButtonDisplayTextOverride; } ``` -------------------------------- ### Authenticate Kolla Connector Source: https://docs.getkolla.com/kolla/developer-resources This function triggers the authentication flow for a given connector without displaying the embedded marketplace. It is designed specifically for OAuth connectors. An optional redirect URL can be provided to specify where the user should be redirected after the authentication process is complete; if not set, it defaults to the current URL. ```APIDOC .authConnector(connectorID: string, redirectURL: string[optional]) connectorID: The unique identifier of the connector to authenticate. redirectURL: (Optional) The URL to redirect to after authentication is finished. Defaults to the current URL if not provided. ``` -------------------------------- ### Close Kolla Integration Marketplace Source: https://docs.getkolla.com/kolla/developer-resources/web-sdk-reference This function programmatically closes the currently open Integration Marketplace modal on your website. ```APIDOC .closeMarketplace() ``` -------------------------------- ### Close Kolla Integration Marketplace Source: https://docs.getkolla.com/kolla/developer-resources This function is used to dismiss the Kolla Integration Marketplace modal. It closes the marketplace window that was previously opened on your website. ```APIDOC .closeMarketplace() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.