# ibm-cloud-sdk-core

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

Latest version **5.6.3** (published 2026-09-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ibm-cloud-sdk-core
pnpm add ibm-cloud-sdk-core
yarn add ibm-cloud-sdk-core
bun add ibm-cloud-sdk-core
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.6.3 |
| Published | 2026-09-28 |
| First published | 2019-03-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20 |
| Dependencies | 16 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | IBM Corp. |
| Maintainers | ibm-cloud-tools-owner, dpopp07, ibm-devx-sdk |
| Keywords | ibm, sdk, openapi, core |

## Links

- npm: https://www.npmjs.com/package/ibm-cloud-sdk-core
- Repository: https://github.com/IBM/node-sdk-core
- Homepage: https://github.com/IBM/node-sdk-core#readme
- Issues: https://github.com/IBM/node-sdk-core/issues
- npm.io page: https://npm.io/package/ibm-cloud-sdk-core

## Dependencies (16)

- [axios](https://npm.io/package/axios.md) 1.20.0
- [debug](https://npm.io/package/debug.md) 4.4.3
- [dotenv](https://npm.io/package/dotenv.md) 16.6.1
- [extend](https://npm.io/package/extend.md) 3.0.2
- [isstream](https://npm.io/package/isstream.md) 0.1.2
- [load-esm](https://npm.io/package/load-esm.md) 1.0.3
- [camelcase](https://npm.io/package/camelcase.md) 6.3.0
- [file-type](https://npm.io/package/file-type.md) 21.3.4
- [form-data](https://npm.io/package/form-data.md) 4.0.6
- [mime-types](https://npm.io/package/mime-types.md) 2.1.35
- [@types/node](https://npm.io/package/@types/node.md) 18.19.130
- [retry-axios](https://npm.io/package/retry-axios.md) 2.6.0
- [@types/debug](https://npm.io/package/@types/debug.md) 4.1.13
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) 9.0.3
- [tough-cookie](https://npm.io/package/tough-cookie.md) 4.1.4
- [@types/tough-cookie](https://npm.io/package/@types/tough-cookie.md) 4.0.5

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 5.6.3 (latest) — 2026-09-28
- 4.3.4 (v4-lts) — 2024-08-28
- 4.3.2-beta-2 (beta) — 2024-05-30
- 3.2.2 (v3-lts) — 2023-01-17
- 0.2.10 (v0.2-lts) — 2021-09-09
- 1.3.1 (v1-lts) — 2019-12-09
- 0.3.7 (v0-lts) — 2019-10-04
- 5.6.2 — 2026-09-18
- 5.6.1 — 2026-09-08
- 5.6.0 — 2026-07-16
- 5.5.0 — 2026-06-19
- 5.4.22 — 2026-06-17
- 5.4.21 — 2026-06-16
- 5.4.20 — 2026-05-21
- 5.4.19 — 2026-05-14
- … 165 more at https://npm.io/package/ibm-cloud-sdk-core/versions

## README

[![Build Status](https://github.com/IBM/node-sdk-core/actions/workflows/build.yaml/badge.svg)](https://github.com/IBM/node-sdk-core/actions/workflows/build.yaml)
[![npm-version](https://img.shields.io/npm/v/ibm-cloud-sdk-core.svg)](https://www.npmjs.com/package/ibm-cloud-sdk-core)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![CLA assistant](https://cla-assistant.io/readme/badge/ibm/node-sdk-core)](https://cla-assistant.io/ibm/node-sdk-core)

# IBM Node.js SDK Core
This project contains core functionality required by Node.js code generated by the IBM Cloud OpenAPI SDK Generator
(openapi-sdkgen).

## Installation
```bash
`npm install ibm-cloud-sdk-core`
```

## Prerequisites
- Node.js version 20 or newer

## Usage
This package exports a single object containing a number of modules as top level properties.

Example:
```js
// this is TypeScript, since the `openapi-sdkgen` project generates TypeScript
import { BaseService } from 'ibm-cloud-sdk-core';

class YourSDK extends BaseService { ... }
```

## Authentication
The node-sdk-core project supports the following types of authentication:
- Basic Authentication
- Bearer Token Authentication
- Identity and Access Management (IAM) Authentication (grant type: apikey)
- Identity and Access Management (IAM) Authentication (grant type: assume)
- Container Authentication
- VPC Instance Authentication
- Cloud Pak for Data Authentication
- No Authentication (for testing)

There are two ways to create an authenticator:
1. Creating an instance and providing credentials programmatically
2. Using the `getAuthenticatorFromEnvironment` function to create an authenticator from externally-provided configuration

For more information about the various authentication types and how to use them with your services, click [here](Authentication.md).

### Examples

#### Programmatic
```js
import { IamAuthenticator } from 'ibm-cloud-sdk-core';

const authenticator = new IamAuthenticator({
  apikey: '{apikey}',
});
```

#### External configuration
```js
import { getAuthenticatorFromEnvironment } from 'ibm-cloud-sdk-core';

// env vars
// MY_SERVICE_AUTH_TYPE=iam
// MY_SERVICE_APIKEY=<apikey>
const iamAuthenticator = getAuthenticatorFromEnvironment('my-service');
```

## Logging
This package uses [debug](https://www.npmjs.com/package/debug) for logging.

- Logging is disabled by default.
- Logging has been configured to use log levels which are assumed to be numerically ascending from most important to least important.
- In order to see the log output, set the environment variable ``DEBUG`` including the desired log level.
  - ```DEBUG=ibm-cloud-sdk-core:error``` enables error logs
  - ```DEBUG=ibm-cloud-sdk-core:warning``` enables warning logs and below
  - ```DEBUG=ibm-cloud-sdk-core:info``` enables info logs and below
  - ```DEBUG=ibm-cloud-sdk-core:verbose``` enables verbose logs and below
  - ```DEBUG=ibm-cloud-sdk-core:debug``` enables debug logs and below

To see the output from all of the debugging levels you can use:

``DEBUG=ibm-cloud-sdk-core*``

The debug logger can be configured to be used for more than one library. For example, you can set a comma-separated string:

``DEBUG=ibm-cloud-sdk-core:debug,other-lib:debug``

## Cookie Jar Support
By default, cookies are not supported in the SDK requests.  If your SDK would benefit from this functionality, simply edit your code to instantiate a cookie jar (or instruct your users to do so) and pass it in the object containing configuration options to the `BaseService` class, as shown below. If the Boolean value `true` is given for the `jar` field, the SDK core will create a default instance of a [Tough Cookie](https://www.npmjs.com/package/tough-cookie).

```ts
import tough = require('tough-cookie');

class MyClass extends BaseService {
  constructor(options: MyOptions) {
    // pass the cookie jar object or simply pass the value `true`
    // and a tough-cookie instance will be created by default
    options.jar = new tough.CookieJar();
    super(options);
  }
}
```

## Issues
If you encounter an issue with this project, you are welcome to submit a [bug report](https://github.com/IBM/node-sdk-core/issues).
Before opening a new issue, please search for similar issues. It's possible that someone has already reported it.

## Tests
Run all test suites:
```bash
npm test
```

## Contributing
See [CONTRIBUTING](CONTRIBUTING.md).

## License
This library is licensed under Apache 2.0. Full license text is
available in [LICENSE](LICENSE.md).

---
_Source: https://npm.io/package/ibm-cloud-sdk-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
