
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
sumsub-node-sdk
Advanced tools
Modern TypeScript/JavaScript SDK for the Sumsub KYC/AML platform with full TypeScript support and dual module format compatibility.
npm install sumsub-node-sdk
# or
yarn add sumsub-node-sdk
import { sdk } from "sumsub-node-sdk";
// or
import SumsubSDK from "sumsub-node-sdk";
const sumsub = sdk({
baseURL: "https://api.sumsub.com",
secretKey: "your-secret-key",
appToken: "your-app-token"
});
// Check API status
const status = await sumsub.getStatus();
console.log("API Status:", status.data);
interface SumsubConfig {
baseURL: string; // Sumsub API base URL
secretKey: string; // Your secret key
appToken: string; // Your app token
}
// Create new applicant
const applicant = await sumsub.createApplicant("external-user-id", "basic-kyc-level", {
email: "user@example.com",
phone: "+1234567890"
});
// Get applicant by ID
const applicantData = await sumsub.getApplicant(applicantId);
// Get applicant by external user ID
const applicantByExternal = await sumsub.getApplicantByExternalUserId("external-user-id");
// Generate access token for web SDK
const accessToken = await sumsub.generateAccessToken("external-user-id", "basic-kyc-level", 1800);
// Get required documents
const requiredDocs = await sumsub.getRequiredIdDocs(applicantId);
// Get applicant status
const status = await sumsub.getReviewStatus(applicantId);
// Add ID document
const document = await sumsub.addIdDocument(
applicantId,
{
idDocType: "PASSPORT",
country: "USA"
},
fileBuffer
);
// Get document image
const image = await sumsub.getDocumentImage(inspectionId, imageId);
// Submit transaction
const transaction = await sumsub.submitTransaction(applicantId, {
txnId: "unique-transaction-id",
txnType: "DEPOSIT",
amount: "1000.00",
currency: "USD"
});
// Get transaction
const txnData = await sumsub.getTransaction(transactionId);
// Find transactions
const transactions = await sumsub.findTransactions({
limit: 10,
order: "createdAt:desc"
});
// Generate Web SDK link
const webSDK = await sumsub.generateWebSDKLink({
externalUserId: "user-123",
levelName: "basic-kyc-level",
ttlInSecs: 1800
});
Full TypeScript support with comprehensive type definitions:
import { SumsubConfig, IdDocType } from "sumsub-node-sdk";
const config: SumsubConfig = {
baseURL: "https://api.sumsub.com",
secretKey: process.env.SUMSUB_SECRET_KEY!,
appToken: process.env.SUMSUB_APP_TOKEN!
};
// Enum support for document types
const docType: IdDocType = IdDocType.PASSPORT;
try {
const applicant = await sumsub.getApplicant("invalid-id");
} catch (error) {
if (error.response) {
console.error("API Error:", error.response.status, error.response.data);
} else {
console.error("Network Error:", error.message);
}
}
SUMSUB_BASE_URL=https://api.sumsub.com
SUMSUB_SECRET_KEY=your-secret-key
SUMSUB_APP_TOKEN=your-app-token
This SDK supports both CommonJS and ES modules:
// CommonJS
const { sdk } = require("sumsub-node-sdk");
// ES Modules
import { sdk } from "sumsub-node-sdk";
import SumsubSDK from "sumsub-node-sdk"; // Default export
axios
(peer dependency) - HTTP clientform-data
- Multipart form data supportnpm run build
npm test
See /tests/sumsub.spec.ts for comprehensive usage examples.
⚠️ BREAKING CHANGE: Automatic URI Encoding
Starting with version 2.0.0, all URL parameters are automatically URI-encoded using encodeURIComponent()
. This ensures proper handling of special characters in parameters.
What Changed:
externalUserId
, levelName
, clientId
, shareToken
, etc.|
, dots .
, etc.) are now properly encodedMigration Guide:
If your code manually encodes parameters, you must remove the manual encoding:
// ❌ Before (v1.x.x) - Manual encoding required
const externalUserId = "auth0|user123";
await sumsub.getApplicantByExternalUserId(encodeURIComponent(externalUserId));
// ✅ After (v2.0.0+) - Automatic encoding, manual encoding will cause double-encoding
const externalUserId = "auth0|user123";
await sumsub.getApplicantByExternalUserId(externalUserId);
Affected Methods:
getApplicantByExternalUserId()
createApplicant()
(levelName parameter)importApplicant()
(levelName parameter)changeApplicantLevel()
(levelName parameter)generateAccessToken()
(externalUserId and levelName parameters)createShareToken()
(clientId parameter)shareApplicant()
(shareToken and resetIdDocSetTypes parameters)getModerationStates()
(applicantId parameter)requestApplicantCheckWithVerificationType()
(reasonCode parameter)getAvailableCurrencies()
(type parameter)This change improves reliability when working with external user IDs containing special characters (like Auth0 user IDs with pipes: auth0|123456
).
For complete API documentation, visit: https://developers.sumsub.com/api-reference
ISC
FAQs
SumSub Node SDK for JavaScript/TypeScript
The npm package sumsub-node-sdk receives a total of 145 weekly downloads. As such, sumsub-node-sdk popularity was classified as not popular.
We found that sumsub-node-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.