@truthlocks/sdk-antifraud
v1.1.1
Published
TypeScript SDK for Truthlocks Anti-Fraud Identity Firewall API
Maintainers
Readme
@truthlocks/sdk-antifraud
TypeScript SDK for the Truthlocks Anti-Fraud Identity Firewall. Real-time risk evaluation, deepfake detection, account takeover prevention, and velocity scoring.
Install
npm install @truthlocks/sdk-antifraudGet an API Key (Free — 10 Seconds, No Website)
# Option 1: Via CLI
npx @truthlocks/protect register --email [email protected]
# Option 2: Via SDK
import { TruthlockClient } from '@truthlocks/sdk';
const { apiKey } = await TruthlockClient.register({ email: '[email protected]' });
# Option 3: Via MCP (Claude/ChatGPT)
# Call tool: truthlocks_register { email: "[email protected]" }
# Option 4: Via VS Code
# Command Palette → "MAIP: Register Developer"
# Option 5: Via cURL
curl -X POST https://sandbox-api.truthlocks.com/v1/developers/register \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","source":"curl"}'Free tier: 1,000 risk evaluations/month. No credit card required.
Quick Start
import { AntifraudClient } from '@truthlocks/sdk-antifraud';
const client = new AntifraudClient({ apiKey: 'tl_test_your_key' });
// Evaluate risk for a transaction
const decision = await client.evaluate({
subject_id: 'user-123',
event_type: 'payment',
amount: 5000,
currency: 'USD',
ip_address: '203.0.113.1',
device_fingerprint: 'fp_abc123',
});
console.log(decision.risk_level); // "low" | "medium" | "high" | "critical"
console.log(decision.action); // "allow" | "challenge" | "block"Features
Risk Evaluation
const result = await client.evaluate({ subject_id, event_type, signals });Deepfake Detection
const scan = await client.deepfake.scan({ media_url: 'https://...' });Account Takeover Detection
const ato = await client.ato.evaluate({ user_id, login_context });Velocity Scoring
const velocity = await client.velocity.record({ subject_id, action: 'purchase' });Block / Challenge / Quarantine
await client.block({ subject_id, reason: 'suspicious_pattern' });
await client.challenge({ subject_id, challenge_type: 'sms_otp' });10 Signing Algorithms
All cryptographic receipts support: Ed25519, ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384, PS512
Free Tier (No Credit Card)
| Resource | Limit | |----------|-------| | Risk evaluations | 1,000/month | | Deepfake scans | 10/month | | Velocity scoring | Unlimited | | Algorithms | All 10 |
Upgrade at console.truthlocks.com/upgrade
Documentation
License
MIT
