{"id":23338754,"url":"https://github.com/appfeel/sms-node","last_synced_at":"2025-04-07T13:44:41.926Z","repository":{"id":57364367,"uuid":"148769466","full_name":"appfeel/sms-node","owner":"appfeel","description":"Node.js library to send SMS (short message service) texts via conversasge.com","archived":false,"fork":false,"pushed_at":"2018-09-14T10:17:36.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-13T16:37:41.981Z","etag":null,"topics":["api","api-server","api-service","node","node-js","node-module","nodejs","sms","sms-api","sms-gateway","sms-messages","sms-notifications","sms-service","sms-verification"],"latest_commit_sha":null,"homepage":"http://converssage.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appfeel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-14T09:50:13.000Z","updated_at":"2024-11-07T16:11:41.000Z","dependencies_parsed_at":"2022-09-13T21:00:47.063Z","dependency_job_id":null,"html_url":"https://github.com/appfeel/sms-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fsms-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fsms-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fsms-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfeel%2Fsms-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appfeel","download_url":"https://codeload.github.com/appfeel/sms-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247666005,"owners_count":20975785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-server","api-service","node","node-js","node-module","nodejs","sms","sms-api","sms-gateway","sms-messages","sms-notifications","sms-service","sms-verification"],"created_at":"2024-12-21T03:16:19.511Z","updated_at":"2025-04-07T13:44:41.906Z","avatar_url":"https://github.com/appfeel.png","language":"JavaScript","readme":"Node Send SMS\n========\n\nA node.js module that allows to send SMS.\n\n[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://npmjs.org/package/sms-node)\n[![NPM version](http://img.shields.io/npm/v/sms-node.svg?style=flat)](https://npmjs.org/package/sms-node)\n[![Downloads](http://img.shields.io/npm/dm/sms-node.svg?style=flat)](https://npmjs.org/package/sms-node)\n[![Build Status](http://img.shields.io/travis/appfeel/sms-node.svg?style=flat)](https://travis-ci.org/appfeel/sms-node)\n[![Coverage Status](https://coveralls.io/repos/github/appfeel/sms-node/badge.svg?branch=master)](https://coveralls.io/github/appfeel/sms-node?branch=master)\n[![Dependencies](https://david-dm.org/appfeel/sms-node/status.svg)](https://david-dm.org/appfeel/sms-node)\n\n- [Installation](#installation)\n- [Requirements](#requirements)\n- [Features](#features)\n- [Usage](#usage)\n- [LICENSE](#license)\n\n## Installation\n\n```bash\nnpm install sms-node --save\n```\n\n## Requirements\n\n- [ ] Node version \u003e= 6.x.x\n- [ ] Register an account at [converssage.com](http://converssage.com)\n\n## Features\n\n- Powerful and intuitive.\n- Multi country cheap SMS.\n- Automatically detects destination device type.\n- Unified error handling.\n- Written in ES6, compatible with ES5 through babel transpilation.\n\n## Usage \n\n### 1. Import and setup sms-node module\n\nSetup your account settings to send SMS:\n\n```js\nconst SMS = require('sms-node');\n\nconst settings = {\n    user: 'Pepe',\n    password: 'xxx',\n    url: 'https://gateway.plusmms.net/rest/message',\n};\nconst sender = new SMS(settings);\n```\n\n- **user**: user name from your account at [converssage.com](http://converssage.com)\n- **password**: your account password\n- **url**: (optional) [converssage.com](http://converssage.com) gateway url, should not be changed, defaults to `https://gateway.plusmms.net/rest/message`\n\n### 2. Define message data\n\nCreate a JSON object with `title`, `body`, `to` and other fields if needed:\n\n```js\nconst data = {\n    from: 'New SMS', // Title for SMS\n    text: 'Powered by AppFeel', // Text for SMS\n    to: ['34666666666'], // Telephone numbers to whom the SMS will be sent\n    encoding: 'gsm', // Optional\n    fsend: null, // Optional\n    parts: 1, // Optional\n    trsec: false, // Optional\n};\n\n// Multiple destinations\ndata.to =  ['34666666666', '10646464642'];\n\n```\n\n- **to**: You can send an SMS to multiple devices, creating an array with different telephone numbers composed by mandatory REGION_NUMBER + PHONE_NUMBER.\n\n### 3. Send the SMS\n\nYou can use it in node callback style:\n```js\nsender.sms(body, (err, result) =\u003e {\n    if (err) {\n        console.log(err);\n    } else {\n\t    console.log(result);\n    }\n});\n```\n\nOr you can use it in promise style:\n```js\nsender.sms(body)\n    .then((results) =\u003e { ... })\n    .catch((err) =\u003e { ... });\n```\n\n- **err**: will be null if all went fine, otherwise will return an array with the errors:\n```js\n[\n    {\n        statusCode: 207, // Message status code\n        accepted: false, // Shows whether the SMS has been made or not\n        message: '400 - \"{\\\\\"error\\\\\":{\\\\\"code\\\\\":102,\\\\\"description\\\\\":\\\\\"No valid recipients\\\\\"}}[{\\\\\"accepted\\\\\":false,\\\\\"to\\\\\":\\\\\"34\\\\\",\\\\\"error\\\\\":{\\\\\"code\\\\\":102,\\\\\"description\\\\\":\\\\\"No valid recipients\\\\\"}}]\"', // Full error message  \n        error: '{\"error\":{\"code\":102,\"description\":\"No valid recipients\"}}[{\"accepted\":false,\"to\":\"34\",\"error\":{\"code\":102,\"description\":\"No valid recipients\"}}]', // Full string error  \n    },\n    ...\n]\n```\n\n- `result` will contain an array with the message responses:\n```js\n[\n    {\n        statusCode: 200, // Message status code\n        accepted: true, // Shows whether the SMS has been made or not\n        to: '34666666666', // Number to whom the message was sent \n        id: '102648820', // Number to identify the message\n    },\n    ...\n]\n```\n\n## LICENSE\n\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2018 AppFeel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n*\u003cp style=\"font-size: small;\" align=\"right\"\u003e\u003ca color=\"#232323;\" href=\"http://appfeel.com\"\u003eMade in Barcelona with \u003cspan color=\"#FCB\"\u003e\u003c3\u003c/span\u003e and \u003cspan color=\"#BBCCFF\"\u003eCode\u003c/span\u003e\u003c/a\u003e\u003c/p\u003e*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfeel%2Fsms-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappfeel%2Fsms-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfeel%2Fsms-node/lists"}