Socket
Book a DemoInstallSign in
Socket

@socketsecurity/sdk

Package Overview
Dependencies
Maintainers
2
Versions
177
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

latest
Source
npmnpm
Version
3.2.0
Version published
Weekly downloads
563
-38.8%
Maintainers
2
Weekly downloads
 
Created
Source

@socketsecurity/sdk

Socket Badge CI Coverage

Follow @SocketSecurity Follow @socket.dev on Bluesky

JavaScript SDK for Socket.dev API.

Install

pnpm add @socketsecurity/sdk

Usage

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

Documentation

GuideDescription
Getting StartedQuick start for contributors (5 min setup)
API ReferenceComplete API method documentation
Usage ExamplesReal-world patterns and code samples
Quota ManagementCost tiers (0/10/100) and utilities
Testing GuideTest helpers, fixtures, and patterns
Method ReferenceQuick method selection guide

Examples

See usage-examples.md for complete examples including:

  • Package security analysis
  • Batch operations
  • Full scans with SBOM
  • Policy management
  • Quota planning

License

MIT

FAQs

Package last updated on 09 Dec 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