Overview ๐ฆ
CardScan provides pre-built API clients for multiple programming languages to simplify integration with our platform. These clients are generated from our OpenAPI specification and provide type-safe interfaces for all API operations.
Available Clients
Installation
TypeScript/JavaScript
npm install @cardscan.ai/cardscan-client
# or
yarn add @cardscan.ai/cardscan-client
Python
pip install cardscan-client
Swift
// Package.swift
dependencies: [
.package(url: "https://github.com/CardScan-ai/api-clients.git", from: "1.0.0")
]
Kotlin
// build.gradle
implementation 'com.cardscan:api:1.0.0'
Dart
# pubspec.yaml
dependencies:
cardscan_client: ^1.0.0
Quick Start
All clients follow a similar pattern:
Initialize the client with your API key
Generate a session token for your user
Use the client to create cards, upload images, and retrieve results
// TypeScript example
import { CardScanApi } from '@cardscan.ai/cardscan-client';
const client = new CardScanApi({
apiKey: 'sk_test_cardscan_ai_...'
});
// Generate session token
const { Token, IdentityId, session_id } = await client.getAccessToken({
user_id: 'unique-user-id'
});
// Create a card
const card = await client.createCard({
sessionToken: Token,
enable_backside_scan: false
});
Features
All API clients provide:
Type Safety: Strongly typed request and response objects
Authentication: Built-in handling of API keys and session tokens
Error Handling: Consistent error types and messages
Async Support: Modern async/await patterns (where applicable)
Auto-retry: Configurable retry logic for transient failures
Documentation: Inline documentation and code completion
Source Code
The API clients are open source and available at: https://github.com/CardScan-ai/api-clients
Custom Clients
If you need to generate a client for a language not listed above, you can use our OpenAPI specification with any OpenAPI code generator:
# Example using OpenAPI Generator
openapi-generator generate \
-i https://raw.githubusercontent.com/CardScan-ai/api-clients/main/openapi.yaml \
-g <language> \
-o ./generated-client
Last updated
Was this helpful?