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

@aws-sdk/client-secrets-manager

Package Overview
Dependencies
Maintainers
5
Versions
426
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-secrets-manager

AWS SDK for JavaScript Secrets Manager Client for Node.js, Browser and React Native

  • 3.572.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1M
decreased by-17.56%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/client-secrets-manager?

The @aws-sdk/client-secrets-manager package is a client library for interacting with AWS Secrets Manager service. It allows developers to manage secrets needed in their applications without hardcoding sensitive information. The package provides functionalities such as creating, reading, updating, and deleting secrets, as well as retrieving the current value of a secret.

What are @aws-sdk/client-secrets-manager's main functionalities?

Create a Secret

This code sample demonstrates how to create a new secret in AWS Secrets Manager.

const { SecretsManagerClient, CreateSecretCommand } = require('@aws-sdk/client-secrets-manager');

const client = new SecretsManagerClient({ region: 'your-region' });
const command = new CreateSecretCommand({
  Name: 'MyTestSecret',
  SecretString: 'MySecretValue'
});

const run = async () => {
  try {
    const data = await client.send(command);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
};

run();

Retrieve a Secret Value

This code sample shows how to retrieve the current value of a secret stored in AWS Secrets Manager.

const { SecretsManagerClient, GetSecretValueCommand } = require('@aws-sdk/client-secrets-manager');

const client = new SecretsManagerClient({ region: 'your-region' });
const command = new GetSecretValueCommand({
  SecretId: 'MyTestSecret'
});

const run = async () => {
  try {
    const data = await client.send(command);
    console.log(data.SecretString);
  } catch (error) {
    console.error(error);
  }
};

run();

Update a Secret

This code sample illustrates how to update the value of an existing secret in AWS Secrets Manager.

const { SecretsManagerClient, UpdateSecretCommand } = require('@aws-sdk/client-secrets-manager');

const client = new SecretsManagerClient({ region: 'your-region' });
const command = new UpdateSecretCommand({
  SecretId: 'MyTestSecret',
  SecretString: 'NewSecretValue'
});

const run = async () => {
  try {
    const data = await client.send(command);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
};

run();

Other packages similar to @aws-sdk/client-secrets-manager

FAQs

Package last updated on 08 May 2024

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