This repository contains examples to perform integrations with the Cobalt platform. It follows a monorepo structure and includes four integration methods, detailed below.
Before you can run the examples in this repository you would need to have the following:
- Node.js > 18
npmoryarn(should be automatically installed with Node.js)
To test the Hosted-Portal method:
-
Navigate to the
hosted-portalfolder:cd hosted-portal -
In the
hosted-portalfolder, create a.envfile with the following variables:NEXT_PUBLIC_API_KEY=tkef8652c2-8ea9-4a09-966a-55b60f1c9635 NEXT_PUBLIC_LINKED_ACCOUNT_ID=sample_user4
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
The project will start on
http://localhost:3000.
To test the JS-SDK method:
-
Navigate to the
js-sdkfolder:cd js-sdk -
In the
js-sdkfolder, create a.envfile with the following variables:NEXT_PUBLIC_API_KEY=tkef8652c2-8ea9-4a09-966a-55b60f1c9635 NEXT_PUBLIC_LINKED_ACCOUNT_ID=sample_user4
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
The project will start on
http://localhost:3000.
To test the React-SDK method:
-
Navigate to the
react-sdkfolder:cd react-sdk -
Navigate to the
backendfolder:cd backend -
Create a
.envfile with the following variables:API_KEY=tkef8652c2-8ea9-4a09-966a-55b60f1c9635 USER_ID=sample_user4 PORT=5000
-
Install backend dependencies:
npm install
-
Start the backend server:
npm run server
or
node server.js
The server will start running on the specified port or on
http://localhost:5000. -
Go to the
frontendfolder:cd ../frontend -
Install frontend dependencies:
npm install
-
Start the client-side application:
npm run dev
For more details on using the Cobalt SDK, refer to Cobalt Docs.