@ibm-cloud/secrets-manager-instance-management

中文文档
2.0.5发布于 2026/11/01Apache-2.0构建来源已验证

Client library for IBM Cloud Secrets Manager instance management

原始使用文档
文档目录10 节
  1. Overview
  2. Prerequisites
  3. Installation
  4. Authentication
  5. Examples
  6. Using the SDK
  7. Basic usage
  8. Issues
  9. Contributing
  10. License

IBM Cloud Secrets Manager Management Node SDK

A Node.js client library to interact with the IBM Cloud® Secrets Manager Instance Management APIs.

Important: This SDK is for use with instances of the IBM Cloud Secrets Manager Vault Enterprise plan only. It is not compatible with other Secrets Manager plans.

Table of Contents

Overview

The IBM Cloud Secrets Manager Management Node.js SDK allows developers to programmatically interact with the following IBM Cloud services:

Service nameImport path
Secrets Manager Management@ibm-cloud/secrets-manager-instance-management/secrets-manager-instance-management/v2

Prerequisites

Installation

npm install @ibm-cloud/secrets-manager-instance-management

Authentication

Secrets Manager uses token-based Identity and Access Management (IAM) authentication.

With IAM authentication, you supply an API key that is used to generate an access token. Then, the access token is included in each API request to Secrets Manager. Access tokens are valid for a limited amount of time and must be regenerated.

Authentication for this SDK is accomplished by using IAM authenticators. Import authenticators from @ibm-cloud/secrets-manager-instance-management/auth.

Examples

Programmatic credentials

import { IamAuthenticator } from '@ibm-cloud/secrets-manager-instance-management/auth';

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

External configuration

import { getAuthenticatorFromEnvironment } from '@ibm-cloud/secrets-manager-instance-management/auth';

// env vars
// SECRETS_MANAGER_INSTANCE_MANAGEMENT_API_APIKEY=<apikey>
const iamAuthenticator = getAuthenticatorFromEnvironment('SECRETS_MANAGER_INSTANCE_MANAGEMENT_API');

To learn more about IAM authenticators and how to use them in your Node.js application, see the IBM Node.js SDK Core documentation.

Using the SDK

Basic usage

  • All methods return a Promise that either resolves with the response from the service or rejects with an Error. The response contains the body, the headers, the status code, and the status text. If using async/await, use try/catch for handling errors.
  • Use the serviceUrl parameter to set the endpoint URL that is specific to your Secrets Manager service instance. To find your endpoint URL, you can copy it from the Endpoints section on the Overview page in the Secrets Manager UI.

Examples

Construct a service client and use it to generate an admin token and get instance details.

const SecretsManagerInstanceManagement = require('@ibm-cloud/secrets-manager-instance-management/secrets-manager-instance-management/v2');
const { IamAuthenticator } = require('@ibm-cloud/secrets-manager-instance-management/auth');


async function secretsManagerInstanceManagementExample() {
  // Authenticate with IAM using your IBM Cloud API key
  const authenticator = new IamAuthenticator({
    apikey: process.env.SECRETS_MANAGER_INSTANCE_MANAGEMENT_API_APIKEY,
  });

  // Create an instance of the SDK by providing an authentication mechanism and the service endpoint URL
  const secretsManagerInstanceManagement = new SecretsManagerInstanceManagement({
    authenticator,
    serviceUrl: '<SERVICE_URL>',
  });

  // Generate admin token
  let res = await secretsManagerInstanceManagement.adminTokenGenerate({
    instanceCrn: '<INSTANCE_CRN>',
  });

  console.log('Admin token generated!');

  // Get instance details
  res = await secretsManagerInstanceManagement.instanceDetails({
    instanceCrn: '<INSTANCE_CRN>',
  });

  console.log('Instance details:\n' + JSON.stringify(res.result, null, 2));
}

secretsManagerInstanceManagementExample();

Replace the apikey, SERVICE_URL, and INSTANCE_CRN values. Then run your application.

For more information and IBM Cloud SDK usage examples for Node.js, see the IBM Cloud SDK Common documentation

Issues

If you encounter an issue with the project, you're welcome to submit a bug report to help us improve.

Contributing

For general contribution guidelines, see CONTRIBUTING.

License

This SDK project is released under the Apache 2.0 license. The license's full text can be found in LICENSE.

版本与发布记录

@ibm-cloud/secrets-manager-instance-management 共发布 6 个版本,首次发布于 2026/07/21;过去 12 个月发布了 6 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.0.5latest2026/11/012 天前
2.0.42026/10/1222 天前
2.0.32026/08/192 个月前
2.0.22026/07/213 个月前
2.0.02026/07/213 个月前
0.0.02026/07/213 个月前

关于 @ibm-cloud/secrets-manager-instance-management 的常见问题

@ibm-cloud/secrets-manager-instance-management 是什么?

用于IBM Cloud Secrets Manager实例管理的客户端库

如何安装 @ibm-cloud/secrets-manager-instance-management?

在项目目录运行 npm install @ibm-cloud/secrets-manager-instance-management,或使用 pnpm add / yarn add / bun add。

@ibm-cloud/secrets-manager-instance-management 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ibm-cloud__secrets-manager-instance-management 是否存在。

@ibm-cloud/secrets-manager-instance-management 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ibm-cloud/secrets-manager-instance-management 可以商用吗?

@ibm-cloud/secrets-manager-instance-management 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ibm-cloud/secrets-manager-instance-management 还在维护吗?

最新版本 2.0.5 发布于 2026/11/01(2 天前);至今共发布 6 个版本,其中过去 12 个月发布了 6 个;首次发布于 2026/07/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。