NexeraID KYC SDK
- NexeraID KYC SDK, written in TypeScript.
How to install
$ npm install @nexeraid/kyc-sdk
First steps
- You need to provide NexeraID Team with the Web App domain and a Webhook
- You need to provide NexeraID with the required rules
- NexeraID Team will provide to you with an API_KEY and a RULE_ID
How to use
Server app
const response = await fetch('https://api.nexera.id/kyc/auth/access-token', {
body: JSON.stringify({ publicAddress }),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`
},
method: 'POST'
})
const { accessToken } = await response.json()
const response = await fetch('https://api.nexera.id/compliance/rules/execute', {
body: JSON.stringify({
inputData: input.data,
address: input.address,
policyId: `${POLICY_ID}`,
}),
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_KEY}`
},
method: 'POST'
})
const validationResult = await response.json()
Web app
const KYC_CLIENT = new KycClient({ onSignPersonalData: async (data: string) => {
return await signMessageAsync({ message: data });
}});
KYC_CLIENT.onSignPersonalData(async (data: string) => {
return await signMessageAsync({ message: data })
})
KYC_CLIENT.onZkCallback(async (data) => {
const tx = await signer.data.sendTransaction(data);
return tx.hash;
});
const signingMessage = KycClient.buildSignatureMessage(address)
const signature = await signMessageAsync({ message: signingMessage })
const accessToken = getAccessTokenFromYourServer(address)
KYC_CLIENT.startVerification({
accessToken: accessToken,
signature: signature,
signingMessage: signingMessage,
});
KYC_CLIENT.startManagement({
accessToken: accessToken,
signature: signature,
signingMessage: signingMessage,
});
Keep Updated
For the latest changes, see the CHANGELOG.