Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@socketsecurity/sdk

Package Overview
Dependencies
Maintainers
3
Versions
25
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

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1K
decreased by-39.23%
Maintainers
3
Weekly downloads
 
Created
Source

@socketsecurity/sdk

npm version TypeScript types js-standard-style Follow @SocketSecurity

SDK for the Socket API client, generated by api.

Usage

npm install @socketsecurity/sdk

ESM / TypeScript

import { SocketSdk } from '@socketsecurity/sdk'

const client = new SocketSdk('yourApiKeyHere')

const res = await client.getQuota()

if (res.success) {
  // Will output { quota: 123 } if the quota you have left is 123
  console.log(res.data)
}

CommonJS

const { SocketSdk } = require('@socketsecurity/sdk')

SocketSdk Methods

Package methods

  • getIssuesByNPMPackage(packageName, version)
    • packageName: A string representing the name of the npm package you want the issues for
    • version: A string representing the version of the npm package to return the issues for
  • getScoreByNPMPackage(packageName, version)
    • packageName: A string representing the name of the npm package you want the score for
    • version: A string representing the version of the npm package to return the score for

Report methods

  • createReportFromFilePaths(filePaths, pathsRelativeTo=.)
    • filePaths: An array of absolute or relative string paths to package.json and any corresponding package-lock.json files
    • pathsRelativeTo: A string path that the absolute paths filePaths are relative to. This to calculate where in your project the package.json/package-lock.json files lives
  • getReportList()
  • getReport(id)
    • id: A string representing the id of a created report

Utility methods

  • getQuota()

See also

FAQs

Package last updated on 04 Nov 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc