
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@creativecodelabs/ocr
Advanced tools
OCR module for document scanning - receipts, invoices, and expense documents using Mindee
OCR module for document scanning - receipts, invoices, and expense documents using Mindee.
npm install @ccl/ocr
Initialize the OCR client with your Mindee API key:
import { initOcrClient } from '@ccl/ocr';
initOcrClient({
apiKey: process.env.MINDEE_API_KEY,
// Optional: custom model IDs
receiptModelId: 'your-custom-receipt-model',
invoiceModelId: 'your-custom-invoice-model',
});
import { scanReceiptFromUrl, scanReceiptFromBase64, isReceiptValid } from '@ccl/ocr';
// From URL
const result = await scanReceiptFromUrl('https://example.com/receipt.jpg');
// From base64
const result = await scanReceiptFromBase64(base64String, 'receipt.jpg');
// Check validity
if (isReceiptValid(result)) {
console.log('Merchant:', result.merchantName);
console.log('Total:', result.totalAmount, result.currency);
console.log('Date:', result.transactionDate);
}
import { scanInvoiceFromUrl, scanInvoiceFromBase64, isInvoiceValid } from '@ccl/ocr';
// From URL
const result = await scanInvoiceFromUrl('https://example.com/invoice.pdf');
// From base64
const result = await scanInvoiceFromBase64(base64String, 'invoice.pdf');
// Check validity
if (isInvoiceValid(result)) {
console.log('Vendor:', result.vendorName);
console.log('Invoice #:', result.invoiceNumber);
console.log('Total:', result.totalAmount);
console.log('Due Date:', result.dueDate);
console.log('Line Items:', result.lineItems);
}
| Field | Type | Description |
|---|---|---|
merchantName | string | null | Store/merchant name |
merchantAddress | string | null | Merchant address |
transactionDate | string | null | Date (ISO format) |
totalAmount | string | null | Total amount |
taxAmount | string | null | Tax/VAT amount |
currency | string | null | Currency code (USD, EUR, ZAR) |
paymentMethod | string | null | Payment method if detected |
lineItems | ReceiptLineItem[] | Individual items |
confidence | object | Confidence scores (0-1) |
| Field | Type | Description |
|---|---|---|
vendorName | string | null | Vendor/supplier name |
vendorAddress | string | null | Vendor address |
customerName | string | null | Customer/bill-to name |
customerAddress | string | null | Customer address |
invoiceNumber | string | null | Invoice number |
invoiceDate | string | null | Invoice date |
dueDate | string | null | Payment due date |
totalAmount | string | null | Total amount |
subtotal | string | null | Subtotal before tax |
taxAmount | string | null | Tax amount |
currency | string | null | Currency code |
poNumber | string | null | Purchase order number |
lineItems | InvoiceLineItem[] | Line items |
confidence | object | Confidence scores (0-1) |
import { OcrError } from '@ccl/ocr';
try {
const result = await scanReceiptFromUrl(url);
} catch (error) {
if (error instanceof OcrError) {
switch (error.code) {
case 'NOT_CONFIGURED':
// Client not initialized
break;
case 'AUTH_ERROR':
// Invalid API key
break;
case 'RATE_LIMIT':
// Rate limit exceeded
break;
case 'INVALID_INPUT':
// Bad input (corrupt image, etc.)
break;
case 'API_ERROR':
// General API error
break;
}
}
}
MIT
FAQs
OCR module for document scanning - receipts, invoices, and expense documents using Mindee
The npm package @creativecodelabs/ocr receives a total of 2 weekly downloads. As such, @creativecodelabs/ocr popularity was classified as not popular.
We found that @creativecodelabs/ocr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.