npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@effect-aws/secrets-manager

v1.0.1

Published

[![npm version](https://img.shields.io/npm/v/%40effect-aws%2Fsecrets-manager?color=brightgreen&label=npm%20package)](https://www.npmjs.com/package/@effect-aws/secrets-manager) [![npm downloads](https://img.shields.io/npm/dm/%40effect-aws%2Fsecrets-manager

Downloads

77

Readme

@effect-aws/secrets-manager

npm version npm downloads

This package provides a fromSecretsManager ConfigProvider constructor function. You can use it to read secrets from AWS Secrets Manager as a Config schema.

The config primitive name must match the secret Name or ARN in Secrets Manager. For example, Config.string("my_secret_name") or Config.string("arn:aws:secretsmanager:eu-central-1:123456789012:secret:my_secret_name-AbCdEf").

Installation

npm install --save @effect-aws/secrets-manager @effect-aws/client-secrets-manager

Usage

With default service layer:

import { Effect, Config, Console } from "effect";
import { fromSecretsManager } from "@effect-aws/secrets-manager";

const program = Effect.gen(function* () {
  const secret: string = yield* Config.string("my_secret_name");

  yield* Console.log("Secret from Secrets Manager: ", secret);
});

program.pipe(
  Effect.provide(Layer.setConfigProvider(fromSecretsManager())),
  Effect.runPromise,
);

With custom service layer:

import { Effect, Config, Console, Layer } from "effect";
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
import {
  BaseSecretsManagerServiceLayer,
  SecretsManagerClientInstance,
} from "@effect-aws/client-secrets-manager";
import { fromSecretsManager } from "@effect-aws/secrets-manager";

const program = Effect.gen(function* () {
  const secret: string = yield* Config.string("my_secret_name");

  yield* Console.log("Secret from Secrets Manager: ", secret);
});

const SecretsManagerClientInstanceLayer = Layer.succeed(
  SecretsManagerClientInstance,
  new SecretsManagerClient({ region: "eu-central-1" }),
);

const serviceLayer = Layer.provide(
  BaseSecretsManagerServiceLayer,
  SecretsManagerClientInstanceLayer,
);

program.pipe(
  Effect.provide(Layer.setConfigProvider(fromSecretsManager({ serviceLayer }))),
  Effect.runPromise,
);