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

medusajs-talksasa-sms-plugin

v1.0.3

Published

Talksasa SMS Notification Provider for MedusaJS

Readme

Medusajs Talksasa SMS plugin

Medusa Plugin NPM Version

A robust, production-ready SMS notification provider plugin for MedusaJS v2.

This plugin seamlessly integrates the Talksasa API into your Medusa store's Notification Module, allowing you to send transactional SMS messages (like order confirmations, shipping updates, and verification codes) to your customers globally.


🌟 Features

  • Native Medusa v2 Support: Built specifically for the Medusa v2 Notification Module architecture (AbstractNotificationProviderService).
  • Cost Saving Guardrails: Automatically skips sending (and bypasses API calls) if a customer's phone number is missing, preventing unnecessary API errors or costs.
  • Omni-Channel Ready: Designed to work flawlessly alongside Email and WhatsApp notification providers in your global subscribers.
  • Simple Configuration: Plugs directly into your medusa-config.ts without complex setup.

📋 Prerequisites

🚀 Installation

Install the plugin using your preferred package manager in your Medusa backend project:

npm install medusajs-talksasa-sms-plugin
# or
yarn add medusajs-talksasa-sms-plugin

⚙️ Configuration

1. Environment Variables

Add your Talksasa API credentials to your Medusa backend's .env file. You can find these in your Talksasa developer dashboard.

(Note: Ensure your API Token includes the ID prefix if provided, e.g., 3318|cjVm7zz...)

TALKSASA_API_TOKEN=your_full_talksasa_api_token
TALKSASA_SENDER_ID=your_registered_sender_id

2. Medusa Config

Next, register the plugin in your medusa-config.ts file under the Notification Module:

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

loadEnv(process.env.NODE_ENV || 'development', process.cwd())

module.exports = defineConfig({
  projectConfig: {
    // ... your standard project config
  },
  modules: [
    {
      resolve: Modules.NOTIFICATION,
      options: {
        providers: [
          // ... your other providers (e.g. Resend, SendGrid)
          {
            resolve: "medusajs-talksasa-sms-plugin",
            id: "talksasa-sms",
            options: {
              channels: ["sms"],
              apiToken: process.env.TALKSASA_API_TOKEN,
              senderId: process.env.TALKSASA_SENDER_ID,
            },
          },
        ],
      },
    },
  ],
})

💻 Usage Example

Once installed, the plugin listens for notification requests directed to the "sms" channel.

You can dispatch SMS notifications directly from your Medusa Workflows or Subscribers. The plugin will automatically extract the plain-text message from the text field in your data payload.

In a Subscriber

import { SubscriberArgs } from "@medusajs/framework"
import { Modules } from "@medusajs/framework/utils"
import { INotificationModuleService } from "@medusajs/framework/types"

export default async function orderPlacedHandler({
  event,
  container,
}: SubscriberArgs<any>) {
  const notificationModuleService: INotificationModuleService = container.resolve(Modules.NOTIFICATION)
  
  const customerPhoneNumber = "254700000000" // Fetch this from your order/customer data
  
  await notificationModuleService.createNotifications({
    to: customerPhoneNumber,
    channel: "sms",
    template: "order-placed-sms", // Required by Medusa type definitions
    data: {
      text: `Great news! Your order #${event.data.id} has been placed successfully.`,
    },
  })
}

🤝 Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on the repository.

📄 License

This project is licensed under the MIT License.