Node.js SDK (Express)
Corbado provides you with a Node.js (Express) SDK that eases the integration.
To proceed with the following steps, you will require your project ID and API secret. If you don't have this information yet, please follow steps 1-3 of the Getting Started guide.
The Node.js SDK (Express) is commonly referred to as a private client, specifically designed for usage within closed backend applications. This particular SDK should exclusively be utilized in such environments, as it is crucial to ensure that the API secret remains strictly confidential and is never shared.
npm install @corbado/node-sdk --save
Now, you can create an instance of the Node.js SDK:
1
const Corbado = require('@corbado/node-sdk');
2
3
const config = new Corbado.Configuration(<project ID>, <API secret>);
4
const corbado = new Corbado.SDK(config);
1
import {SDK, Configuration} from '@corbado/node-sdk';
2
3
const config = new Configuration(<project ID>, <API secret>);
4
const corbado = new SDK(config);
If you have existing users and need webhooks to communicate with them, please add the webhook username and password to the config:
1
const Corbado = require('@corbado/node-sdk');
2
3
const config = new Corbado.Configuration(<project ID>, <API secret>);
4
config.webhookUsername = <webhook username>;
5
config.webhookPassword = <webhook password>;
6
const corbado = new Corbado.SDK(config);
1
import {SDK, Configuration} from '@corbado/node-sdk';
2
3
const config = new Configuration(<project ID>, <API secret>);
4
config.webhookUsername = <webhook username>;
5
config.webhookPassword = <webhook password>;
6
const corbado = new SDK(config);
1
const Corbado = require('@corbado/node-sdk');
2
3
const config = new Corbado.Configuration(<project ID>, <API secret>);
4
config.frontendAPI = <CNAME>;
5
const corbado = new Corbado.SDK(config);
1
import {SDK, Configuration} from '@corbado/node-sdk';
2
3
const config = new Configuration(<project ID>, <API secret>);
4
config.frontendAPI = <CNAME>;
5
const corbado = new SDK(config);
Last modified 6h ago