SDK DOCUMENTATION
SDK Documentation
Complete guide to integrating TrustVerify SDK into your applications
Quick Navigation
Getting Started
Start building secure transactions with TrustVerify SDK in minutes
Prerequisites
- • Node.js 16+ or Python 3.8+
- • TrustVerify API key (get from Developer Portal)
- • Basic understanding of REST APIs
Install SDK
npm or pip install
Initialize
Configure with API key
Start Building
Create your first transaction
Installation
npm
npm install @trustverify/sdkInitialize
import { TrustVerify } from '@trustverify/sdk';
const trustVerify = new TrustVerify({
apiKey: 'your_api_key_here',
environment: 'production' // or 'sandbox'
});Transaction Management
Create Transaction
const transaction = await trustVerify.transactions.create({
title: 'Website Development Project',
description: 'Custom e-commerce website development',
amount: 2500.00,
currency: 'USD',
buyerEmail: 'buyer@example.com',
sellerEmail: 'seller@example.com',
category: 'digital_services',
deliveryTimeframe: '7_days'
});
console.log('Transaction created:', transaction.id);KYC Verification
Submit Verification
const verification = await trustVerify.kyc.submitVerification({
userId: 'user_123',
documentType: 'passport',
documentNumber: 'P123456789',
personalInfo: {
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '1990-01-01',
address: {
street: '123 Main St',
city: 'New York',
country: 'US',
postalCode: '10001'
}
},
documents: {
frontId: 'base64_encoded_image',
backId: 'base64_encoded_image',
selfie: 'base64_encoded_image'
}
});Fraud Detection
Analyze Risk
const fraudResult = await trustVerify.fraud.analyze({
transactionId: 'txn_123',
userAgent: req.headers['user-agent'],
ipAddress: req.ip,
deviceFingerprint: 'device_fingerprint_hash',
behaviorData: {
sessionDuration: 120,
clickPattern: 'normal',
typingSpeed: 'average'
}
});
if (fraudResult.riskScore > 0.8) {
// High risk - requires additional verification
console.log('High risk transaction detected');
}Need Help?
Check out our API reference or contact our developer support team.