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

optec-whatsapp-api-sender

v1.1.0

Published

Send WhatsApp messages via Optec API with ease.

Readme

Optec WhatsApp API Sender

Optec WhatsApp API Sender هو مكتبة NPM تتيح لك إرسال الرسائل عبر API الخاصة بـ Optec بسهولة باستخدام تقنيات متعددة مثل React و Vue و Angular و Pure JS.

💡 المميزات

  • دعم متعدد الإطارات: تدعم المكتبة العديد من الإطارات مثل React و Vue و Angular و Pure JS
  • إرسال رسائل فردية وجماعية: تتيح لك إرسال رسائل واحدة أو عدة رسائل دفعة واحدة
  • إعدادات مخصصة: يمكنك تكوين المكتبة من خلال ملف config.json، بما في ذلك client_id ورمز الدولة
  • دعم ديناميكي للغات البرمجة: يتم تحميل ملفات الأمثلة بناءً على إطار العمل الذي تستخدمه

🚀 كيفية التثبيت

1. تثبيت المكتبة

لتثبيت المكتبة عبر NPM، قم بتشغيل الأمر التالي:

npm install optec-whatsapp-api-sender

2. تشغيل إعدادات المكتبة

بعد تثبيت المكتبة، يمكنك تشغيل إعدادات المكتبة وتحديد الإطار الذي تستخدمه (React، Vue، Angular، Pure JS) باستخدام الأمر التالي:

npx optec-setup

سيقوم هذا الأمر بإنشاء الملفات المناسبة لكل إطار عمل.

⚙️ الإعدادات

1. تكوين الملف config.json

عند تشغيل الإعدادات لأول مرة، سيتم إنشاء ملف config.json في المشروع الخاص بك يحتوي على الإعدادات الافتراضية. يحتوي الملف على:

  • client_id: معرف العميل الذي يتم استخدامه للتوثيق
  • country_code: رمز الدولة الافتراضي (مثل +20 لمصر)

إذا كنت بحاجة إلى تغييره، يمكنك فتح الملف وتعديله يدويًا.

{
  "client_id": "ضع_هنا_الكلاينت_ايدي",
  "country_code": "+20"
}

2. تعديل الإعدادات

يمكنك تعديل إعدادات المكتبة من خلال تغيير القيم في ملف config.json حسب متطلباتك الخاصة.

✨ الأمثلة

تتوفر الأمثلة للغات البرمجة المختلفة في مجلد examples، حيث يتم تحميل الأمثلة بناءً على الإطار الذي تختاره:

  1. React:

    • examples/react/send-single-message.jsx: مثال لإرسال رسالة واحدة باستخدام React
  2. Vue:

    • examples/vue/send-single-message.vue: مثال لإرسال رسالة واحدة باستخدام Vue
  3. Angular:

    • examples/angular/send-single-message.component.ts: مثال لإرسال رسالة واحدة باستخدام Angular
  4. Pure JS:

    • examples/pure-js/send-single-message.js: مثال لإرسال رسالة واحدة باستخدام JavaScript البسيط

🛠️ استخدام المكتبة

1. إرسال رسالة فردية

يمكنك استخدام المكتبة لإرسال رسالة واحدة عن طريق استدعاء دالة sendSingleMessage:

مثال:

const { sendSingleMessage } = require('optec-whatsapp-api-sender');

async function sendMessage() {
  const mobile = '1234567890';
  const text = 'هذه رسالة تجريبية';

  try {
    const response = await sendSingleMessage(mobile, text);
    console.log('تم إرسال الرسالة بنجاح:', response);
  } catch (error) {
    console.error('فشل إرسال الرسالة:', error.message);
  }
}

sendMessage();

2. إرسال رسائل جماعية

يمكنك أيضًا إرسال مجموعة من الرسائل دفعة واحدة عن طريق استدعاء دالة sendBulkMessages:

مثال:

const { sendBulkMessages } = require('optec-whatsapp-api-sender');

async function sendMessages() {
  const messages = [
    { mobile: '1234567890', text: 'رسالة 1' },
    { mobile: '0987654321', text: 'رسالة 2' },
  ];

  try {
    const response = await sendBulkMessages(messages);
    console.log('تم إرسال الرسائل بنجاح:', response);
  } catch (error) {
    console.error('فشل إرسال الرسائل:', error.message);
  }
}

sendMessages();

🌍 الترجمة والدعم اللغوي

إذا كنت بحاجة إلى دعم أو مساعدة في الترجمة أو إذا كنت ترغب في إضافة ميزات أخرى للمكتبة، يمكنك إنشاء مشكلة (issue) أو طلب سحب (pull request) في المستودع.

📄 الترخيص

يتم ترخيص مكتبة Optec WhatsApp API Sender بموجب رخصة MIT.

💬 تواصل معنا

  • البريد الإلكتروني: [email protected]
  • الموقع الرسمي: https://optec-eg.store

ملاحظات

  • الاختبار: تأكد من اختبار المكتبة في بيئتك المحلية قبل استخدام أي ميزات في بيئات الإنتاج.
  • التحديثات: سيتم تحديث المكتبة بانتظام لدعم المزيد من الإطارات والميزات الجديدة.