1
Get your credentials from API
First, you need to create an account at JAAK and get your credentials from API.
- Register platform.jaak.ai
- Go to Setup → API Kys
- Generates a new API Key for your environment (sandbox or production)
- Keep your
API _ KEYandAPI _ SECRET
Important: Don't put your INDIVIDUAL _ INDIVIDUAL API in code from the client's side.
2
Install the SDK
Install the SDK of JAAK in your project:
npm
npm install @ jaak / sdkyarN
yarn add @ jaak / sdk3
Configure the client
Initiates JAAK with your credentials:
JavaScript / TypeScript
import { JaakClient } from '@jaak/sdk';
const jaak = new JaakClient({
apiKey: process.env.JAAK_API_KEY,
apiSecret: process.env.JAAK_API_SECRET,
environment: 'sandbox' // o 'production'
});4
Create your first check
Create a check session and get the link for the user:
JavaScript / TypeScript
// Crear una sesión de verificación
const session = await jaak.verification.create({
type: 'identity',
config: {
documentTypes: ['ine', 'passport'],
livenessCheck: true,
faceMatch: true
},
metadata: {
userId: 'user_123',
orderId: 'order_456'
},
redirectUrl: 'https://tuapp.com/verificacion-completada'
});
console.log(session.verificationUrl);
// https://verify.jaak.ai/session/abc123
// Redirige al usuario a session.verificationUrl5
Receives result
Configure a web hole to get the result of the check:
Express.js example
app.post('/webhooks/jaak', async (req, res) => {
const { event, data } = req.body;
// Verifica la firma del webhook
const isValid = jaak.webhooks.verify(
req.headers['x-jaak-signature'],
req.body
);
if (!isValid) {
return res.status(401).send('Invalid signature');
}
if (event === 'verification.completed') {
const { sessionId, status, result } = data;
if (status === 'approved') {
// Usuario verificado exitosamente
console.log('Verificación aprobada:', result);
} else {
// Verificación rechazada
console.log('Verificación rechazada:', result.reason);
}
}
res.status(200).send('OK');
});That's it!
The user will be redirected to JAAK To complete his monitoring and you will get the result through web gain.