Use a USB fingerprint reader
For partners with hardware scanners, the SDK talks to a local hardware service running on the user’s workstation. You work with enroll, verify, and search directly; the transport is hidden.
Companion application required
Every contactful (physical-scanner) capture flow requires the SladeID companion application running on the user’s device alongside the browser. The web SDK alone cannot drive USB scanners — the companion app brokers access to the hardware.
- SladeID Android — install from the Google Play Store .
- SladeID Windows — available on request. Contact your Slade ID integration contact.
The browser-only contactless capture flows (Capture a fingerprint, Enroll a face) do not require the companion app.
Prerequisites
- The SladeID companion application running on the workstation, with a compatible scanner attached.
- A token source for the companion service — implement
getTokento fetch from your auth service.
Full example
import { createFingerprintReader, HwsError } from '@sladeid/slade-id-sdk';
const reader = createFingerprintReader({
getToken: async () => fetchHwsToken(),
});
reader.on('connected', () => console.log('companion app reachable'));
reader.on('device-attached', (d) => console.log('device:', d.name));
reader.on('device-detached', (d) => console.log('removed:', d.id));
const session = reader.createEnrollmentSession({
enrollee: 'subject-123',
position: 2, // right index
});
session.on('ready', () => prompt('Place your finger on the scanner'));
session.on('scanning', () => showSpinner());
session.on('captured', (result) => {
console.log('enrolled, template length', result.template?.length);
});
session.on('error', (err) => {
if (err instanceof HwsError) {
console.error(err.code, err.correlationId);
}
});
try {
await session.start();
} finally {
hideSpinner();
}What can go wrong
ConnectionErrorwith codeREADER_CONNECTION_FAILED— the SladeID companion application isn’t running on the workstation. Ask the user to launch it (Android or Windows, see above).DeviceUnavailableError— no reader plugged in, or the reader is in use by another application.ReaderAuthError— the token was rejected. Check yourgetTokenimplementation and the companion app’s auth configuration.BiometricMismatchError— only thrown by the rejection-style helpers. Plainverify()resolves with{ matched: false }instead.