Prerequisites
Before you begin, you’ll need:
A TXCloud account (sign up here )
An API key from your dashboard
Node.js 18+ (for JavaScript SDK) or Python 3.8+ (for Python SDK)
Step 1: Get Your API Key
Navigate to API Keys
In your dashboard, go to Settings → API Keys .
Create a New Key
Click Create API Key , give it a name, and select the permissions you need. Store your API key securely. It will only be shown once!
Your API key will look like this:
txc_live_a1b2c3d4e5f6g7h8i9j0...
Step 2: Install the SDK
JavaScript
Python
Go
cURL
npm install @txcloud/sdk
# or
yarn add @txcloud/sdk
# or
pnpm add @txcloud/sdk
go get github.com/txcloud/txcloud-go
No installation needed! Use cURL directly: curl https://api.txcloud.io/v1/identity/verify \
-H "Authorization: Bearer YOUR_API_KEY"
Step 3: Initialize the Client
import TXCloud from '@txcloud/sdk' ;
const txcloud = new TXCloud ({
apiKey: process . env . TXCLOUD_API_KEY ,
// Optional: use sandbox for testing
environment: 'sandbox' // or 'production'
});
Step 4: Verify Your First Identity
Let’s verify a user’s identity document:
// Verify an identity document
const verification = await txcloud . identity . verify ({
document_front: fs . readFileSync ( 'id_front.jpg' , 'base64' ),
document_back: fs . readFileSync ( 'id_back.jpg' , 'base64' ),
selfie: fs . readFileSync ( 'selfie.jpg' , 'base64' ),
country: 'MA' ,
document_type: 'national_id' ,
checks: [ 'ocr' , 'face_match' , 'liveness' , 'fraud' ]
});
console . log ( 'Status:' , verification . status );
console . log ( 'Name:' , verification . extracted_data . full_name );
console . log ( 'Face Match:' , verification . checks . face_match . match );
Response
{
"id" : "ver_a1b2c3d4e5f6" ,
"status" : "verified" ,
"created_at" : "2025-01-15T10:30:00Z" ,
"extracted_data" : {
"full_name" : "Mohammed El Amrani" ,
"date_of_birth" : "1990-05-15" ,
"document_number" : "AE123456" ,
"nationality" : "Moroccan" ,
"expiry_date" : "2028-05-14"
},
"checks" : {
"ocr" : { "status" : "passed" , "confidence" : 0.95 },
"face_match" : { "status" : "passed" , "similarity" : 0.92 },
"liveness" : { "status" : "passed" , "confidence" : 0.98 },
"fraud" : { "status" : "passed" , "risk_score" : 120 }
}
}
Congratulations! You’ve successfully verified your first identity with TXCloud.
Step 5: Set Up Webhooks (Optional)
For async workflows, configure webhooks to receive real-time updates:
// Create a webhook endpoint
const webhook = await txcloud . developers . webhooks . create ({
url: 'https://yourapp.com/webhooks/txcloud' ,
events: [
'identity.verification.completed' ,
'identity.verification.failed' ,
'fraud.signal.detected'
],
secret: 'whsec_your_secret_here'
});
Learn More About Webhooks Configure and secure your webhook endpoints
Next Steps
Now that you’ve made your first API call, explore more features:
Sandbox vs Production
TXCloud provides a sandbox environment for testing. Sandbox requests don’t affect real data and use test credentials.
Environment Base URL API Key Prefix Sandbox https://sandbox.api.txcloud.io/v1txc_test_...Production https://api.txcloud.io/v1txc_live_...
Always use sandbox for development and testing. Production API calls may incur charges.
Need Help?