
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@socketsecurity/sdk
Advanced tools
JavaScript SDK for Socket.dev API - Security analysis, vulnerability scanning, and compliance monitoring for software supply chains.
pnpm add @socketsecurity/sdk
Note: Version 2.0+ is ESM-only. For CommonJS support, use version 1.x.
import { SocketSdk } from '@socketsecurity/sdk'
const client = new SocketSdk('your-api-key', {
retries: 3, // Retry failed requests up to 3 times
retryDelay: 1000, // Start with 1s delay, exponential backoff
timeout: 30000, // 30 second timeout
})
// Check your quota
const quota = await client.getQuota()
if (quota.success) {
console.log(`Available quota: ${quota.data.quota} units`)
}
// Analyze a package
const result = await client.getScoreByNpmPackage('express', '4.18.0')
if (result.success) {
console.log(`Security Score: ${result.data.score}/100`)
}
// Batch analyze multiple packages
const batchResult = await client.batchPackageFetch({
components: [
{ purl: 'pkg:npm/express@4.18.0' },
{ purl: 'pkg:npm/react@18.0.0' }
]
})
Quick security checks: batchPackageFetch() • batchPackageStream() • getIssuesByNpmPackage() • getScoreByNpmPackage()
Project scanning: createDependenciesSnapshot() • createOrgFullScan() • createScanFromFilepaths() • getScan() • getScanList() • getSupportedScanFiles()
Organizations and repositories: getOrganizations() • createOrgRepo() • getOrgRepo() • getOrgRepoList() • updateOrgRepo() • deleteOrgRepo()
Security configuration: getOrgSecurityPolicy() • updateOrgSecurityPolicy() • getOrgLicensePolicy() • updateOrgLicensePolicy() • postSettings()
Deep analysis: getOrgFullScanList() • getOrgFullScanMetadata() • getOrgFullScanBuffered() • streamOrgFullScan() • deleteOrgFullScan()
Scan comparison: createOrgDiffScanFromIds() • getDiffScanById() • listOrgDiffScans() • deleteOrgDiffScan()
Security fixes: streamPatchesFromScan() • viewPatch()
Alert management: getOrgTriage() • updateOrgAlertTriage()
SBOM export: exportCDX() • exportSPDX() • searchDependencies() • uploadManifestFiles()
Categorization: createOrgRepoLabel() • getOrgRepoLabel() • getOrgRepoLabelList() • updateOrgRepoLabel() • deleteOrgRepoLabel()
Usage metrics: getQuota() • getOrgAnalytics() • getRepoAnalytics() • getAuditLogEvents()
API tokens: getAPITokens() • postAPIToken() • postAPITokensRotate() • postAPITokensRevoke() • postAPITokenUpdate()
Feature access: getEnabledEntitlements() • getEntitlements()
Cost helpers: getQuotaCost() • getRequiredPermissions() • calculateTotalQuotaCost() • hasQuotaForMethods() • getMethodsByQuotaCost() • getMethodsByPermissions() • getQuotaUsageSummary() • getAllMethodRequirements()
Raw API access: getApi() • sendApi()
→ Quota Management - Cost tiers: 0 (free), 10 (standard), 100 (batch/uploads)
→ Testing Utilities - Mock factories, fixtures, type guards
MIT
FAQs
SDK for the Socket API client
The npm package @socketsecurity/sdk receives a total of 4,081 weekly downloads. As such, @socketsecurity/sdk popularity was classified as popular.
We found that @socketsecurity/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.