Cobalt Modals
Utilize the Cobalt React SDK for frontend and embed it within your React application.
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.
2. Generate Session Token
Generate a Session Token for your Linked Account.
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
Cobalt Embedded flow is a frontend SDK that allows you to embed Cobalt auth flow into your React application.
It’s a simple process involving steps like Generate Session Token
> Install and Initialise Frontend SDK
and Render the Component
.
Install
Install @cobaltio/react-cobalt-js
and @cobaltio/cobalt-js
via the terminal.
Initialise
Import Provider
& Config
Render Cobalt Connect
Perform the on click action to render the react component of Cobalt connect
- Config component needs to be wrapped inside the Provider component.
- Pass the Cobalt session token (that you generated using the Cobalt backend SDK) to the provider.
Learn more about Cobalt’s React SDK and how to initialize it here.
For example implementation, you can check out the App.js file in the example directory.
By completing these steps, you have successfully implemented Cobalt’s React Frontend SDK for authentication with apps.