{"_id":"@anisafifi/sms-kit","_rev":"2-5158b0d6f769d893232a2de5284c5228","name":"@anisafifi/sms-kit","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@anisafifi/sms-kit","version":"0.0.1","keywords":["SMS Sender","Bulk SMS","Generator"],"author":{"name":"Anis Afifi"},"license":"MIT","_id":"@anisafifi/sms-kit@0.0.1","maintainers":[{"name":"anisafifi","email":"anis@afifi.pro"}],"homepage":"https://codewithafifi.com/tools/sms-kit/","dist":{"shasum":"92f8aa856f96626b9d867bc037c8c37374494a4e","tarball":"https://registry.npmjs.org/@anisafifi/sms-kit/-/sms-kit-0.0.1.tgz","fileCount":7,"integrity":"sha512-lgySVLxFchxrYP0bQZ/9Ij1V+oAx5yD6dU/rXXRCBFza781P4ncLnI5SL/wRRe1WeLq7V+ar4vTwqMGiiLLZoQ==","signatures":[{"sig":"MEYCIQDnOloDr/7SiAgpRD90lte6GiUW8eNduRORdScopbsdewIhAMJsIZ1PUAAmUBFo37vvloWEa12LaCEtr2+wkK9mQ7gP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8211},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"4e4aded93d432a33519760964d21b5d290edc322","scripts":{"build":"tsup"},"_npmUser":{"name":"anisafifi","email":"anis@afifi.pro"},"_npmVersion":"10.8.2","description":"An easy-to-use SMS sender for Bangladesh","directories":{},"_nodeVersion":"20.18.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.6","typescript":"^5.7.3","@types/node":"^22.12.0"},"_npmOperationalInternal":{"tmp":"tmp/sms-kit_0.0.1_1738295858937_0.1510500779357593","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2025-01-31T03:57:38.839Z","modified":"2026-02-08T13:44:36.651Z","0.0.1":"2025-01-31T03:57:39.131Z"},"author":{"name":"Anis Afifi"},"license":"MIT","homepage":"https://codewithafifi.com/tools/sms-kit/","keywords":["SMS Sender","Bulk SMS","Generator"],"description":"An easy-to-use SMS sender for Bangladesh","maintainers":[{"name":"anisafifi","email":"anis@afifi.pro"}],"readme":"# SMS Kit - A Simple Bulk SMS Sender\n\nA simple and easy-to-use SMS sender package for Bangladesh. The package allows you to send SMS messages using an API and can automatically grab API credentials from environment variables.\n\n## Installation\n\n```sh\nnpm install @anisafifi/sms-kit\n```\n\n## Importing the Module\n\n```ts\nimport { sendSms } from \"@anisafifi/sms-kit\";\n```\n\n## Usage\n\nYou can use the package to send SMS messages by calling the `sendSms` function. This function accepts the following parameters:\n\n### **`sendSms` function**\n\n```typescript\nsendSms({\n  recipientNumbers: string[],  // Array of recipient phone numbers (in international format, e.g., '+8801712345678')\n  message: string,             // The message to be sent\n  apiKey?: string,             // Your API key (optional, will use environment variable if not provided)\n  apiUrl?: string,             // The API URL (optional, will use environment variable if not provided)\n  senderId?: string            // The sender ID (optional, will use environment variable if not provided)\n});\n```\n\n### Example:\n\n```typescript\nimport { sendSms } from \"@anisafifi/sms-kit\";\n\n// Send an SMS message\nsendSms({\n  recipientNumbers: ['+8801712345678'],\n  message: 'Hello from SMS Kit!'\n}).then(response => {\n  console.log('SMS Response:', response);\n}).catch(error => {\n  console.error('Error:', error);\n});\n```\n\n## Environment Variables\n\nThe following environment variables are supported and will be automatically used if not passed explicitly to the `sendSms` function:\n\n- `SMS_API_KEY`: The API key for your SMS provider.\n- `SMS_API_URL`: The API URL for the SMS provider's endpoint.\n- `SMS_API_SENDER_ID`: The sender ID you wish to use for sending the SMS.\n\nYou can define these variables in your `.env` file or directly in your environment.\n\n### Example `.env` file:\n\n```env\nSMS_API_KEY=your_api_key\nSMS_API_URL=https://api.smsprovider.com\nSMS_API_SENDER_ID=YourSenderID\n```\n\nMake sure to install `dotenv` to load the environment variables if you're using a `.env` file:\n\n```bash\nnpm install dotenv\n```\n\nor you can use any other package that will handle `.env` file.\n\nThen, in your code:\n\n```typescript\nimport dotenv from 'dotenv';\ndotenv.config();\n\n// Now you can use sendSms as usual\nsendSms({\n  recipientNumbers: ['8801*********'],\n  message: 'Hello from SMS Kit!'\n}).then(response => {\n  console.log('SMS Response:', response);\n}).catch(error => {\n  console.error('Error:', error);\n});\n```\n\n## Error Handling\n\nThe `sendSms` function will return an object with the following structure:\n\n```typescript\n{\n  success: boolean;\n  data?: any;\n  error?: string;\n}\n```\n\n- `success`: `true` if the SMS was successfully sent, `false` otherwise.\n- `data`: The response data from the SMS provider if the request was successful.\n- `error`: A string describing the error message if the request failed.\n\n### Example of error response:\n```typescript\n{\n  success: false,\n  error: \"Failed to send SMS. Status: 500\"\n}\n```\n\n## Configuration Options\n\nYou can provide the following configuration options when calling `sendSms`:\n\n- `recipientNumbers`: A list of phone numbers (strings) to send the SMS to. The numbers should be in international format (e.g., `+8801712345678`).\n- `message`: The content of the message you want to send.\n- `apiKey`: (Optional) The API key for the SMS provider. If not provided, it will be fetched from the environment variable `SMS_API_KEY`.\n- `apiUrl`: (Optional) The API URL for the SMS provider. If not provided, it will be fetched from the environment variable `SMS_API_URL`.\n- `senderId`: (Optional) The sender ID to be used for sending the SMS. If not provided, it will be fetched from the environment variable `SMS_API_SENDER_ID`.\n\n## License\n\nThis package is open-source and available under the MIT License.","readmeFilename":"readme.md"}