React DropZone π€
Installation
$ npm i @cardscan.ai/insurance-cardscan-react
$ yarn add @cardscan.ai/insurance-cardscan-reactUsage
import { CardScanDropZone } from "@cardscan.ai/insurance-cardscan-react";Basic Example
import React from "react";
import { render } from "react-dom";
import { CardScanDropZone } from "@cardscan.ai/insurance-cardscan-react";
function onSuccess(card) {
console.log("Card processed successfully:", card);
}
function onError(error) {
console.error('Error occurred:', error);
}
// See Authentication on where to get this sessionToken
const sessionToken = 'JWT_TOKEN'
function App() {
return (
<div className="App">
<div className="DropZoneContainer">
<CardScanDropZone
live={false}
sessionToken={sessionToken}
onSuccess={onSuccess}
onError={onError}
enableBackside={true}
layout="side-by-side"
/>
</div>
</div>
);
}
const rootElement = document.getElementById('root');
render(<App />, rootElement);Compatibility
Peer Dependencies
Configuration
Available Props
Main Props
Prop
Required
Type
Description
Layout Options
Side-by-Side Layout
Sequential Layout
File Requirements
Upload Workflow
UI Customization
Custom Messages
Custom Components
CSS Styling
State Management
Callbacks
onSuccess Callback
onError Callback
onProgress Callback
Error Handling
Error Type
Description
User Action
Integration with CardScanView
Best Practices
Troubleshooting
Common Issues
Last updated
Was this helpful?