Cobalt’s auth flows provides a seamless environment for your users to grant authorization to their third party application data.
When creating application integrations, accessing customer’s data is a required step. Using Cobalt’s auth flows this process becomes both
quick and heavily customizable.
The generated URL can be then used to redirect the user to the Hosted UI, or can be embedded within your UI. Your user can select the application they want to connect and perform authentication.
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 the Cobalt Frontend SDK for JavaScript that you want to use. You can install by either using npm package manager or directly in browser by using the script tag.
<!-- use a specific version --><scriptsrc="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@3.0.1"></script><!-- use a version range instead of a specific version --><scriptsrc="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@3"></script><scriptsrc="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@3.0"></script><!-- omit the version completely to use the latest one --><!-- you should NOT use this in production --><scriptsrc="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js"></script>
Initialize the javascript SDK using the Session token.
Learn more about Cobalt’s JS SDK and how to initialize it here.
Cobalt provides the flexibility for you to manage your customers’ application connections. The .connect() method
lets your customers to connect to an application platform, authorizing you to access the platform APIs and data on their behalf.
cobalt.connect("slack")// opens a new tab for oauth appscobalt.connect("twilio",{number:<"Registered number">,sid:"ACCOUNT_SID",})// saves the auth data for key based apps
The .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.
cobalt.disconnect("slack")
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.
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.