πŸš€ DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

@socketsecurity/sdk

Package Overview
Dependencies
Maintainers
2
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@socketsecurity/sdk

SDK for the Socket API client

Source
npmnpm
Version
1.11.1
Version published
Weekly downloads
717
-45.97%
Maintainers
2
Weekly downloads
Β 
Created
Source

@socketsecurity/sdk

Socket Badge CI

Follow @SocketSecurity Follow @socket.dev on Bluesky

Official SDK for Socket.dev - Programmatic access to security analysis, vulnerability scanning, and compliance monitoring for your software supply chain.

Installation

pnpm add @socketsecurity/sdk

Quick Start

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' }
  ]
})

β†’ Configuration Options

API Methods

Package Analysis - Quick security checks

batchPackageFetch() β€’ batchPackageStream() β€’ getIssuesByNpmPackage() β€’ getScoreByNpmPackage()

β†’ Documentation

Scanning & Analysis - Project scanning

createDependenciesSnapshot() β€’ createOrgFullScan() β€’ createScanFromFilepaths() β€’ getScan() β€’ getScanList() β€’ getSupportedScanFiles()

β†’ Documentation

Organization Management - Orgs and repos

getOrganizations() β€’ createOrgRepo() β€’ getOrgRepo() β€’ getOrgRepoList() β€’ updateOrgRepo() β€’ deleteOrgRepo()

β†’ Documentation

Policy & Settings - Security configuration

getOrgSecurityPolicy() β€’ updateOrgSecurityPolicy() β€’ getOrgLicensePolicy() β€’ updateOrgLicensePolicy() β€’ postSettings()

β†’ Documentation

Full Scan Management - Deep analysis

getOrgFullScanList() β€’ getOrgFullScanMetadata() β€’ getOrgFullScanBuffered() β€’ streamOrgFullScan() β€’ deleteOrgFullScan()

β†’ Documentation

Diff Scans - Compare scans

createOrgDiffScanFromIds() β€’ getDiffScanById() β€’ listOrgDiffScans() β€’ deleteOrgDiffScan()

β†’ Documentation

Patches & Vulnerabilities - Security fixes

streamPatchesFromScan() β€’ viewPatch()

β†’ Documentation

Alert & Triage - Alert management

getOrgTriage() β€’ updateOrgAlertTriage()

β†’ Documentation

Export & Integration - SBOM export

exportCDX() β€’ exportSPDX() β€’ searchDependencies() β€’ uploadManifestFiles()

β†’ Documentation

Repository Labels - Categorization

createOrgRepoLabel() β€’ getOrgRepoLabel() β€’ getOrgRepoLabelList() β€’ updateOrgRepoLabel() β€’ deleteOrgRepoLabel()

β†’ Documentation

Analytics & Monitoring - Usage metrics

getQuota() β€’ getOrgAnalytics() β€’ getRepoAnalytics() β€’ getAuditLogEvents()

β†’ Documentation

Authentication & Access - API tokens

getAPITokens() β€’ postAPIToken() β€’ postAPITokensRotate() β€’ postAPITokensRevoke() β€’ postAPITokenUpdate()

β†’ Documentation

Entitlements - Feature access

getEnabledEntitlements() β€’ getEntitlements()

β†’ Documentation

Quota Utilities - Cost helpers

getQuotaCost() β€’ getRequiredPermissions() β€’ calculateTotalQuotaCost() β€’ hasQuotaForMethods() β€’ getMethodsByQuotaCost() β€’ getMethodsByPermissions() β€’ getQuotaUsageSummary() β€’ getAllMethodRequirements()

β†’ Documentation

Advanced Query Methods - Raw API

getApi() β€’ sendApi()

β†’ Documentation

β†’ Complete API Reference

β†’ Usage Examples

β†’ Quota Management - Cost tiers: 0 units (free), 10 units (standard), 100 units (batch/uploads)

β†’ Testing Utilities - Mock factories, fixtures, and type guards for SDK testing

See Also

License

MIT

FAQs

Package last updated on 06 Oct 2025

Did you know?

Socket

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.

Install

Related posts