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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@spinajs/configuration-aws-secretmanager-protocol

v2.0.550

Published

SpinaJS configuration protocols for AWS Secrets Manager and SSM Parameter Store

Readme

@spinajs/configuration-aws-secretmanager-protocol

Resolves SpinaJS configuration values from AWS Secrets Manager and AWS Systems Manager Parameter Store using custom configuration protocols.

Any string in your configuration that starts with a registered protocol is replaced, at load time, with the value fetched from AWS.

Usage

Import the package once (its side effects register the protocols with the DI container), then use the protocols anywhere in your configuration:

import '@spinajs/configuration-aws-secretmanager-protocol';

export class AppConfig extends FrameworkConfiguration {
  public onLoad() {
    return {
      db: {
        // fetched from AWS Secrets Manager
        password: 'aws-secrets://prod/db/password',
        // a single key out of a JSON secret
        user: 'aws-secrets://prod/db/credentials#username',
      },
      service: {
        // fetched from AWS Parameter Store
        endpoint: 'aws-parameters://prod/service/endpoint',
      },

      // client options are passed straight to the AWS SDK clients (region, credentials, endpoint, ...)
      aws: {
        secretsManager: { region: 'eu-central-1' },
        parameterStore: { region: 'eu-central-1' },
      },
    };
  }
}

Credentials and region follow the standard AWS SDK resolution (shared config/credentials files, AWS_* environment variables, instance/task roles, ...). Anything you put under aws.secretsManager / aws.parameterStore is forwarded to the corresponding SDK client.

Protocols

aws-secrets:// — AWS Secrets Manager

aws-secrets://<secretId>[?versionStage=..&versionId=..][?default=..|optional=true][#json.path]

| Part | Description | | --- | --- | | <secretId> | Secret name or full ARN. | | ?versionStage= | Secret version stage (defaults to AWSCURRENT). | | ?versionId= | Explicit secret version id (takes precedence over the default stage). | | #json.path | Extract a single value from a JSON secret, dot notation for nesting (#db.password). | | ?default= / ?optional=true | See Resilience. |

SecretString secrets are returned as a string. SecretBinary secrets are returned as a base64-encoded string (or parsed as UTF-8 JSON when a #json.path is given).

aws-parameters:// — AWS Parameter Store

aws-parameters://<name>[?withDecryption=true|false][?default=..|optional=true][#json.path]
aws-parameters://<path>/*

| Part | Description | | --- | --- | | <name> | Parameter name. A version/label can be pinned with the native : syntax (my/param:3). | | ?withDecryption= | Decrypt SecureString parameters (defaults to true). | | #json.path | Extract a single value from a JSON parameter (dot notation). | | /* | Expand a whole hierarchy into a nested object (prefix stripped, recursive). | | ?default= / ?optional=true | See Resilience. |

StringList parameters are returned as an array of strings.

Subtree expansion:

// given /prod/app/db/host, /prod/app/db/port, /prod/app/key in Parameter Store
{ app: 'aws-parameters://prod/app/*' }
// resolves to:
{ app: { db: { host: '...', port: '...' }, key: '...' } }

Resilience

By default, if a value cannot be resolved the error is logged and the raw protocol string is left in the configuration. Two opt-in query parameters change that:

  • ?default=<value> — use <value> when the fetch fails (handy for local development without AWS).
  • ?optional=true — resolve to an empty string when the fetch fails.
aws-secrets://prod/db/password?default=localdev
aws-secrets://optional/feature-flag?optional=true

Caching

Resolved values are cached in memory per protocol with a TTL (default 5 minutes), and concurrent requests for the same value are de-duplicated into a single AWS call. Configure or disable the TTL (in ms, 0 disables) per protocol:

aws: {
  secretsManager: { region: 'eu-central-1', cacheTtl: 60000 },
  parameterStore: { region: 'eu-central-1', cacheTtl: 0 },
}