- Install the package
- Authenticate with your API key
- Run your first card-reveal workflow with type-safe responses
This SDK handles the backend payment handling. Youβll also need to integrate our frontend wallet SDK to securely collect credit card details from users.
Step 1: Installation
- Python
- TypeScript
The SDK ships as a single, pure-Python wheel with minimal dependencies β install is ~1 second.
Step 2: Authentication
Grab your secret key from the nekuda customer portal and export it as an environment variable:Step 3: Hello World
- Python
- TypeScript
hello.py
Step 4: End-to-End Flow with Type Safety π―
The snippet below walks through the full payment flow with type-safe responses. This flow requires auser_id
to associate the payment with a user, and a mandate_id
which is obtained after creating a mandate (the userβs intent to purchase).
- Python
- TypeScript
quick_demo.py
Complete Integration: Remember that in a real application, creating a mandate and requesting a token happen on your backend (using this SDK), while the actual card collection happens on your frontend using our React wallet SDK. A
user_id
must be consistently used for both frontend and backend operations for a given user.Step 5: Why Type Safety Matters π‘οΈ
With our typed response models:- No more runtime errors - IDE knows exactly what fields are available
- Autocomplete everywhere - Your editor suggests available fields and methods
- Validation built-in - Card numbers and expiry dates are validated
- Better error messages - Know exactly what went wrong at compile time (TypeScript) or runtime (Python)
- Python
- TypeScript
Whatβs Next?
Core Concepts
Understand NekudaClient, UserContext, and response models
Usage Guide
Deep dive into the complete payment flow
Configuration
Production-ready settings and customization
Error Handling
Build resilient applications with proper error handling