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

serverless-plugin-sync-secrets

v0.0.5

Published

Serverless plugin to sync secrets from AWS Secrets Manager to environment variables

Readme

serverless-plugin-sync-secrets

This is a Serverless Framework that simplifies secrets management by synchronizing encrypted EJSON files with AWS Secrets Manager.

Features

  • Enhanced Security: Decrypts EJSON secrets directly in memory, without writing secrets to temporary files.
  • AWS Integration: Automatically synchronizes secrets with AWS Secrets Manager.
  • Multi-environment Support: Manages different sets of secrets per environment (dev, prod, etc.).
  • Simulation Mode: Preview changes without applying them using "dry run" mode.

Requirements

EJSON

EJSON must be installed in your development environment.

AWS Policies

The following AWS permissions are required for this plugin to work:

  • secretsmanager:GetSecretValue
  • secretsmanager:UpdateSecret
  • secretsmanager:ListSecrets
  • secretsmanager:CreateSecret
  • secretsmanager:DeleteSecret
  • ssm:GetParameter (only if using SSM to store the EJSON key)

Installation

Install the plugin via npm:

npm install --save-dev serverless-plugin-sync-secrets

Add the plugin to your serverless.yml file:

plugins:
  - serverless-plugin-sync-secrets

Usage

Configuration

To configure this plugin, you need to add a syncSecrets section to the custom section of your serverless.yml file. Here is an example:

custom:
  syncSecrets:
    ejson_file_path: path/to/ejson/secrets.ejson
    ejson_key: <ejson-private-key>
    ssm_prefix: <ssm-prefix>
    secret_name: <secret-name>
    exclude: '^_'
    create_secret: true
    show_values: false
    delete_secret: false
    dry: false

Configuration Options

| Option | Description | |------------------|-------------| | ejson_file_path | Path to the EJSON secrets file (default: ./secrets/{stage}.ejson). | | ejson_key | The EJSON private key (optional if ssm_prefix is set). | | ssm_prefix | Prefix in AWS SSM Parameter Store to retrieve the EJSON private key (optional if ejson_key is provided). | | secret_name | Name of the secret in AWS Secrets Manager (default: service name). | | exclude | Regex pattern to exclude specific keys from synchronization (default: '^_'). | | create_secret | If true, creates the secret in AWS Secrets Manager if it does not exist (default: false). | | show_values | If true, shows the secret values in logs instead of markers (default: false). | | delete_secret | If true, deletes the secret instead of creating or updating it (default: false). | | dry | If true, runs in simulation mode without applying changes (default: false). |

Execution

The plugin will runs automatically when executing the serverless deploy command. It is triggered during the before:package:initialize phase of the serverless deployment process.

Example 1

service: my-service

provider:
  name: aws
  architecture: arm64
  runtime: provided.al2
  region: ${opt:region, "us-east-2"}
  stage: ${opt:stage, "dev"}

custom:
  syncSecrets:
    ejson_file_path: ./secrets/${self:provider.stage}.ejson
    ssm_prefix: "/ejson/keys/${self:provider.stage}/EJSON_KEY"
    secret_name: "my-service"
    create_secret: true

plugins:
  - serverless-secret-sync-plugin

Example 2

service: my-service

provider:
  name: aws
  architecture: arm64
  runtime: provided.al2
  region: ${opt:region, "us-east-2"}
  stage: ${opt:stage, "dev"}

custom:
  syncSecrets:
    ejson_key: ${env:EJSON_KEY}

plugins:
  - serverless-secret-sync-plugin