Pre-requisites
Below are a few pre-requisites that you need to do before moving forward: 1. Create Linked Account In order to enable your customer to connect to third party app, you first need to create a Linked account for them using a unique identifier.Know more about Linked Accounts and how you can create one in the guide here.
We recommend you create a linked account at the same time as your customer signs up within your app.
The session token gets expired in 24 hours. Please make sure you generate a new token in every new session or within 24 hours.
Steps to implement
The general steps to build your own flow are:Display a list of integrations for your users to select
Display a list of integrations for your users to select
Retrieve a list of all integrations available to connect using the List Applications API or .getApplications() method and display them in your UI.With the above call you can get all the details related to an appliction for a user.
We recommend using the assets provided by Cobalt as they meet the requirements of the supported integrations. For example QuickBooks
Online require the specific use of QuickBooks branded buttons, including specific hover states.
Install and Initialise SDK
Install and Initialise SDK
Install the Cobalt Frontend SDK for JavaScript that you want to use. You can install by either using Initialize the javascript SDK using the Session token.
npm package manager
or directly in browser by using the script
tag.Learn more about Cobalt’s JS SDK and how to initialize it here.
Manage Connections
Manage Connections
Cobalt provides the flexibility for you to manage your customers’ application connections. The The
.connect()
method
lets your customers to connect to an application platform, authorizing you to access the platform APIs and data on their behalf..disconnect()
method similarly, lets the user to disconnect from the application platform, revoking
the authorization and deleting any and all configurations of the Linked account saved for that particular application.Allow users to configure the connection
Allow users to configure the connection
Once the user has successfully authenticated in their platform, he is redirected back to your app integration page. Use the
.config()
method to find an
exisiting config or creating a new config for the linked account.Save/Update the configuration
Save/Update the configuration
The
.config()
method provides you with all the published workflows and settings input for the user. The user can now enable the workflows,
enter data for the settings and map fields. These updates to the config can be made using the .updateConfig()
method.By completing these steps, you have successfully implemented your own frontend for authentication with apps.