capacitor-microblink
v0.4.0
Published
Capacitor plugin for microblink
Readme
capacitor-microblink
Capacitor plugin for microblink
Install
npm install capacitor-microblink
npx cap syncAndroid Auto Init (on app startup)
If you want initializeBlinkCard to run automatically during Android plugin load (onCreate phase), set plugin config values:
// capacitor.config.ts
plugins: {
Microblink: {
licenseKey: 'YOUR_BLINKCARD_LICENSE_KEY',
licensee: 'OPTIONAL_LICENSEE',
},
}iOS Camera Permission
BlinkCard scanning requires camera access on iOS.
Add this key to your app Info.plist:
<key>NSCameraUsageDescription</key>
<string>We need camera access to scan your card.</string>API
scanCard(...)
scanCard(options: ScanCardOptions) => Promise<ScanCardResult>Starts BlinkCard card scanning flow.
| Param | Type |
| ------------- | ----------------------------------------------------------- |
| options | ScanCardOptions |
Returns: Promise<ScanCardResult>
initializeBlinkCard(...)
initializeBlinkCard(options: InitializeBlinkCardOptions) => Promise<InitializeBlinkCardResult>Initializes BlinkCard SDK/license before scanning.
| Param | Type |
| ------------- | --------------------------------------------------------------------------------- |
| options | InitializeBlinkCardOptions |
Returns: Promise<InitializeBlinkCardResult>
terminateBlinkCard()
terminateBlinkCard() => Promise<TerminateBlinkCardResult>Terminates BlinkCard SDK and clears cached plugin initialization state.
Returns: Promise<TerminateBlinkCardResult>
Interfaces
ScanCardResult
| Prop | Type |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| canceled | boolean |
| resultState | 'empty' | 'uncertain' | 'valid' | 'stageValid' |
| processingStatus | 'success' | 'detectionFailed' | 'imagePreprocessingFailed' | 'stabilityTestFailed' | 'scanningWrongSide' | 'fieldIdentificationFailed' | 'imageReturnFailed' | 'unsupportedCard' |
| cardNumber | string |
| cardNumberValid | boolean |
| cardNumberPrefix | string |
| owner | string |
| cvv | string |
| iban | string |
| expiryDate | BlinkCardDate | null |
BlinkCardDate
| Prop | Type |
| ----------- | ------------------- |
| day | number |
| month | number |
| year | number |
ScanCardOptions
| Prop | Type |
| ---------------------------- | -------------------- |
| licenseKey | string |
| licensee | string |
| extractOwner | boolean |
| extractExpiryDate | boolean |
| extractCvv | boolean |
| extractIban | boolean |
| allowInvalidCardNumber | boolean |
| enableEditScreen | boolean |
InitializeBlinkCardResult
| Prop | Type |
| ----------------- | -------------------- |
| initialized | boolean |
InitializeBlinkCardOptions
| Prop | Type |
| ---------------- | ------------------- |
| licenseKey | string |
| licensee | string |
TerminateBlinkCardResult
| Prop | Type |
| ---------------- | -------------------- |
| terminated | boolean |
