• Сообщество
  • Блог
Документация
Плагины и интеграцииВсе расширения для Medusa от сообществаСтартерыЗапускайте проекты быстрее с готовыми решениями
ЭкспертыПодберите специалиста для разработки и развития вашего проекта на MedusaКейсыПосмотрите примеры Medusa в продакшене и успешные внедрения
Меч Moscow
Комплексная e-commerce платформа на Medusa для московского fashion-бренда

Меч Moscow · Fashion

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы Medusa
  • Плагины и интеграции
  • Стартеры
  • Эксперты
  • Кейсы
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация Gorgo
  • Связаться с нами
  • TelegramGitHub
Плагины
SMSAPI logo

SMSAPI

Отправляйте SMS с опциональным тестовым режимом для безопасной отправки сообщений

npm install @yanchesky/medusa-smsapi
Категория
Уведомления
Создано
Yanchesky
Версия
0.0.1
Последнее обновление
10 месяцев назад
Ежемесячные загрузки
Загрузка данных
Звезды на Github
0
npmNPMGitHubGithub

Medusa v2 SMSAPI Plugin

A notification provider plugin that enables SMS notifications via SMSAPI.com and service for Medusa v2 projects.

Table of Contents

  • Features
  • Prerequisites
  • Installation
  • Configuration
  • Environment Variables
  • Usage
  • Configuration Options
  • Development
  • Contributing
  • Support
  • License

Features

  • SMS Notifications: Send SMS via SMSAPI.io service
  • Test Mode: Safe testing without sending actual SMS

Prerequisites

  • Medusa v2.4.0+
  • Node.js 20+
  • SMSAPI.io Account with API access token
  • Active SMS credits in your SMSAPI account

Installation

1npm install @yanchesky/medusa-smsapi
2# or
3yarn add @yanchesky/medusa-smsapi

Configuration

1. Environment Variables

Create or update your file:

1SMSAPI_ACCESS_TOKEN=your_smsapi_access_token_here
2SMSAPI_FROM=YourBrand

2. Medusa Configuration

Add the plugin to your :

1import { SMSAPIOptions } from '@yanchesky/medusa-smsapi';
2// ...
3module.exports = {
4 // ... other configurations
5 modules: [
6 // ... other modules
7 {
8 resolve: '@yanchesky/medusa-smsapi/providers/smsapi',
9 dependencies: ['logger'] // Optional in test mode to log sent messages
10 options: {
11 channels: ['sms'], // Required: notification channels
12 access_token: process.env.SMSAPI_ACCESS_TOKEN,
13 from: process.env.SMSAPI_FROM,
14 } satisfies SMSAPIOptions,
15 },
16 ],
17}

Usage

Basic SMS Sending

1import { Modules } from '@medusajs/framework/utils';
2// ...
3const notificationService = container.resolve(Modules.NOTIFICATION);
4await notificationService.createNotifications([{
5 channel: 'sms',
6 to: '48123456789', // Country prefix is required
7 template: 'confrimation' // This is required by Medusa but is not used by the plugin.
8 content: {
9 text: "An SMS message"
10 }
11}])

Configuration Options

SMSAPIOptions Interface

1interface SMSAPIOptions {
2 // Required
3 access_token: string // Your SMSAPI access token
4 from: string // Sender name verified by SMSAPI
5 channels: string[] // Notification channels
6
7 // Optional Basic Settings
8 encoding?: string // Message encoding (default: "UTF-8")
9 test?: boolean // Test mode (default: false)
10 api_url?: string // API endpoint (default: "https://smsapi.io/api")
11
12 // Optional Advanced Settings
13 flash?: boolean // Flash SMS (default: false)
14 max_parts?: 1-10 // Maximum number of parts a message can be split into
15 nounicode?: boolean // Prevents from sending messages containing special characters.
16 normalize?: boolean // Converts special characters to regular ones. ę -> e; ć -> c
17 fast?: boolean // Send SMS with the highest priority (default: false)
18}

Test Mode

Enable test mode to validate your setup without sending actual SMS. In test mode a request to API endpoint will be executed validating credentials and logging sent message.

Local Development

1# Run type checking
2yarn typecheck
3# Run linting
4yarn lint
5# Format code
6yarn format
7# Build plugin
8yarn build

Contributing

All contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch ()
  3. Make your changes
  4. Run quality checks ()
  5. Commit your changes ()
  6. Push to the branch ()
  7. Open a Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Add TypeScript types for all new features
  • Include comprehensive error handling
  • Update documentation for new features

Support

  • 📖 Documentation: Medusa Documentation
  • 📋 SMSAPI Docs: SMSAPI.io Documentation
  • 🐛 Issues: GitHub Issues

License

MIT License


Compatibility

  • ✅ Medusa: v2.4.0+
  • ✅ Node.js: 20+
  • ✅ TypeScript: 5+
  • ✅ OPEN API: Latest API version

Еще в этой категории

Посмотреть все
Уведомления
Nodemailer logo

Nodemailer

От Perseides

Отправляйте email-уведомления через Nodemailer (SMTP)

Загрузка данных
npm
Уведомления
Mailgun logo

Mailgun

От Webbers

Отправляйте и управляйте уведомлениями по электронной почте

Загрузка данных
GitHubnpm
Уведомления
Postmark logo

Postmark

От Bram-hammer

Транзакционные письма через Postmark

Загрузка данных
GitHubnpm