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

@enomshop/documents

v1.10.0

Published

Invoice and document generation plugin for MedusaJS v2

Downloads

876

Readme

Medusa Plugin Documents

A Medusa v2 plugin for generating and managing invoices, receipts, and credit notes.

Features

  • Generate PDF Invoices, Receipts, and Credit Notes
  • Multiple PDF Templates (Classic, Modern, Minimal)
  • Automatic generation on order placement, capture, and cancellation
  • Email integration with CC support for company emails
  • Admin UI for managing documents and settings

Installation

yarn add @enomshop/documents

Configuration

You need to tell Medusa to load your plugin (which includes your API routes, Admin UI, and Subscribers) AND register your custom module so that req.scope.resolve("documents") works. Open your medusa-config.ts file and add the following:

module.exports = defineConfig({
  projectConfig: {
    // ...
  },

  // 1. Register the Plugin (Loads Admin UI, API Routes, and Subscribers)
  plugins: [
    {
      resolve: "@enomshop/documents",
      options: {
        // Add any plugin-level options here if you add them in the future
      }
    }
  ],

  // 2. Register the Module (Allows req.scope.resolve("documents"))
  modules: {
    {
      resolve: "@enomshop/documents/modules/documents",
    },
    // IMPORTANT: Your plugin relies on the File and Notification modules.
    // Ensure you have providers configured for them in your main project!
    // Example:
    // [Modules.FILE]: { ... },
    // [Modules.NOTIFICATION]: { ... }
  }
})

Run Database Migrations

The plugin introduces new database tables (document and document_settings). You need to run migrations in your main project so Medusa creates these tables in your Postgres database. Run this command in your main project:


npx medusa db:migrate

Rebuild the Admin Dashboard

Because the plugin injects new React components, pages, and widgets into the Admin dashboard, you must rebuild the admin UI in your main project.


yarn build

Start the Server

Start your Medusa backend and admin dashboard:


yarn dev

Usage

The plugin automatically hooks into Medusa's event system:

  • order.placed: Generates an invoice and sends it to the customer.
  • payment.captured: Generates a receipt and sends it to the customer.
  • order.canceled / order.payment_refunded: Generates a credit note and sends it to the customer.

You can configure the company email and default template from the Medusa Admin dashboard under Settings -> Documents.