New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ibm-cloud-sdk-core

Package Overview
Dependencies
Maintainers
3
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibm-cloud-sdk-core

Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.

  • 5.1.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is ibm-cloud-sdk-core?

The ibm-cloud-sdk-core npm package provides core functionality for IBM Cloud SDKs, including authentication, request handling, and utility functions. It is used as a foundational library for building and interacting with IBM Cloud services.

What are ibm-cloud-sdk-core's main functionalities?

Authentication

The package provides various authenticators, such as IAM, to handle authentication with IBM Cloud services. This code sample demonstrates how to create an IAM authenticator using an API key.

const { IamAuthenticator } = require('ibm-cloud-sdk-core');
const authenticator = new IamAuthenticator({ apikey: 'your-iam-api-key' });

Request Handling

The package provides a BaseService class to facilitate making HTTP requests to IBM Cloud services. This code sample shows how to extend BaseService to create a custom service with a method that makes a GET request.

const { BaseService } = require('ibm-cloud-sdk-core');
class MyService extends BaseService {
  constructor(options) {
    super(options);
  }
  myMethod() {
    const parameters = {
      options: {
        url: '/v1/resource',
        method: 'GET',
      },
      defaultOptions: this.baseOptions,
    };
    return this.createRequest(parameters);
  }
}

Utility Functions

The package includes utility functions like getSdkHeaders to generate standard headers for SDK requests. This code sample demonstrates how to use getSdkHeaders to create headers for a specific service operation.

const { getSdkHeaders } = require('ibm-cloud-sdk-core');
const headers = getSdkHeaders('service-name', 'service-version', 'operation-id');

Other packages similar to ibm-cloud-sdk-core

Keywords

FAQs

Package last updated on 10 Jan 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

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