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

@medita/medusa-sendcloud-plugin

v0.0.3

Published

SendCloud integration plugin for Medusa v2.9.0

Downloads

152

Readme

SendCloud Plugin for Medusa v2.9

A comprehensive SendCloud integration plugin for MedusaJS v2.9.0 that provides shipping and fulfillment capabilities.

Compatibility

  • Medusa v2.9.0+: Fully compatible
  • Medusa v2.8.x and below: Not supported
  • Node.js: v20+ required
  • TypeScript: v5.6+ recommended

Features

  • SendCloud shipment creation and management
  • Order fulfillment integration
  • Webhook handling for tracking updates
  • Admin UI for shipment management
  • Automated shipping workflows
  • Full Medusa v2.9.0 compatibility with latest framework patterns
  • Enhanced type safety with Zod validation
  • Streamlined plugin architecture without loaders

Installation

Local Development

  1. Install dependencies in the plugin folder:
cd sendcloud-medusa
yarn install
  1. Build the plugin:
yarn build
  1. For development with hot-reloading:
yarn dev

Configuration

Using as a Module Provider (Recommended)

In your medusa-config.ts:

import { loadEnv, defineConfig, Modules } from "@medusajs/framework/utils"

module.exports = defineConfig({
  projectConfig: {
    databaseUrl: process.env.DATABASE_URL,
    http: {
      storeCors: process.env.STORE_CORS,
      adminCors: process.env.ADMIN_CORS,
      authCors: process.env.AUTH_CORS,
      jwtSecret: process.env.JWT_SECRET || "supersecret",
      cookieSecret: process.env.COOKIE_SECRET || "supersecret",
    },
  },
  modules: {
    [Modules.FULFILLMENT]: {
      resolve: "@medusajs/medusa/fulfillment",
      options: {
        providers: [
          {
            resolve: "@medita/medusa-sendcloud-plugin/providers/sendcloud-fulfillment",
            id: "sendcloud-fulfillment",
            options: {
              apiKey: process.env.SENDCLOUD_API_KEY,
              apiSecret: process.env.SENDCLOUD_API_SECRET,
              baseUrl: process.env.SENDCLOUD_BASE_URL,
              partnerId: process.env.SENDCLOUD_PARTNER_ID,
              defaultCountry: process.env.SENDCLOUD_DEFAULT_COUNTRY || 'NL',
            },
          },
        ],
      },
    },
  },
});

Alternative: Using as a Plugin

You can also register it as a plugin (includes additional features like webhooks and admin APIs):

plugins: [
  {
    resolve: "@medita/medusa-sendcloud-plugin",
    options: {
      apiKey: process.env.SENDCLOUD_API_KEY,
      apiSecret: process.env.SENDCLOUD_API_SECRET,
      baseUrl: process.env.SENDCLOUD_BASE_URL,
      partnerId: process.env.SENDCLOUD_PARTNER_ID,
      defaultCountry: process.env.SENDCLOUD_DEFAULT_COUNTRY || 'NL',
    },
  },
],

Environment Variables

Add these to your .env file:

SENDCLOUD_API_KEY=your_api_key
SENDCLOUD_API_SECRET=your_api_secret
SENDCLOUD_BASE_URL=https://panel.sendcloud.sc/api/v2
SENDCLOUD_PARTNER_ID=your_partner_id
SENDCLOUD_DEFAULT_COUNTRY=NL  # Optional: Default country code (ISO 2-letter format)

Configuration Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | apiKey | string | ✅ | - | Your SendCloud API public key | | apiSecret | string | ✅ | - | Your SendCloud API secret key | | baseUrl | string | ❌ | https://panel.sendcloud.sc/api/v2 | SendCloud API base URL | | partnerId | string | ❌ | - | Your SendCloud partner ID (if applicable) | | defaultCountry | string | ❌ | NL | Default country code for shipments (ISO 2-letter format) |

Note on defaultCountry: This is used as a fallback when:

  • Product origin country is not specified (affects customs declarations)
  • Sender address country is missing
  • Return shipment origin country is not available

Common values: NL (Netherlands), DE (Germany), FR (France), BE (Belgium), etc.

API Routes

The plugin provides the following API routes:

Admin Routes

  • GET /admin/sendcloud - List all shipments
  • GET /admin/sendcloud/:id - Get shipment details
  • POST /admin/sendcloud - Create a shipment
  • PUT /admin/sendcloud/:id - Update a shipment
  • DELETE /admin/sendcloud/:id - Delete a shipment

Webhook Routes

  • POST /webhooks/sendcloud - Handle SendCloud webhooks for tracking updates

Workflows

The plugin includes the following workflows:

  • createShipmentWorkflow - Creates a SendCloud shipment for an order
  • updateTrackingWorkflow - Updates tracking information from webhooks

Module Services

SendCloudModuleService

Main service for managing SendCloud shipments:

const sendCloudService = container.resolve("sendcloud");

// Create a shipment
const shipment = await sendCloudService.createShipment({
  order_id: "order_123",
  // ... shipment data
});

// Get shipments for an order
const shipments = await sendCloudService.getShipmentByOrderId("order_123");

License

MIT

npx medusa plugin:build yalc update @medita/medusa-sendcloud-plugin npx medusa plugin:add @medita/medusa-sendcloud-plugin