NexeraID JS SDK
- NexeraID JS SDK, use anywhere JS runs.
How to install
npm install @nexeraid/js-sdk
First steps
- Access your Nexera Application's Settings > API page and get the API key.
How to use
const apiClient = createApiClient({
apiKey: API_KEY,
});
Self-provided authentication
If you already have your own authentication system, you can create a user session like so:
const sessionRes = await apiClient.createSession({
workflowId: WORKFLOW_ID,
externalUserId: "35194",
});
Please find below an example endpoint using express:
const apiClient = createApiClient({
apiKey: API_KEY,
});
app.get('/my-nexera-auth', (req, res) => {
const userId = req.userId;
const authSession = await apiClient.createSession({
workflowId: WORKFLOW_ID,
externalUserId: userId,
});
res.json(authSession);
});
Web3 auth
TODO