{"id":20016853,"url":"https://github.com/labsmobile/sms-node","last_synced_at":"2025-07-26T00:33:13.863Z","repository":{"id":215681522,"uuid":"731733605","full_name":"labsmobile/sms-node","owner":"labsmobile","description":"Official Node library for LabsMobile SMS API.","archived":false,"fork":false,"pushed_at":"2024-01-19T16:08:06.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T04:39:14.090Z","etag":null,"topics":["javascript","nodejs","npm","npm-library","sms","sms-api","sms-notifications"],"latest_commit_sha":null,"homepage":"https://www.labsmobile.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/labsmobile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-14T18:48:04.000Z","updated_at":"2024-01-05T19:50:12.000Z","dependencies_parsed_at":"2024-11-10T03:32:55.176Z","dependency_job_id":"d4362ed3-eddb-4cbe-9403-728759359df4","html_url":"https://github.com/labsmobile/sms-node","commit_stats":null,"previous_names":["labsmobile/sms-node"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/labsmobile/sms-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labsmobile","download_url":"https://codeload.github.com/labsmobile/sms-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labsmobile%2Fsms-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267093817,"owners_count":24034950,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","nodejs","npm","npm-library","sms","sms-api","sms-notifications"],"created_at":"2024-11-13T08:13:25.262Z","updated_at":"2025-07-26T00:33:13.839Z","avatar_url":"https://github.com/labsmobile.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://avatars.githubusercontent.com/u/152215067?s=200\u0026v=4\" height=\"80\"\u003e\n\u003c/p\u003e\n\n# LabsMobile-Node\n\n![](https://img.shields.io/badge/version-1.0.1-blue.svg)\n\nSend SMS messages through the LabsMobile platform and the node library.\n\n## Documentation\n\n- Labsmobile API documentation can be found [here][apidocs].\n\n## Features\n\n- Send SMS messages.\n- Get account credits\n- Get prices by country\n- Manage scheduled sendings\n- HLR Request (Check mobile)\n\n## Requirements\n\n- A user account with LabsMobile. Click on the link to create an account [here][signUp].\n- This library supports node v16.19.0 and higher versions of node.\n\n## Installation\n\nTo install the [labsmobile-sms][packages] library, it is recommended to use [npm][getnpm].\n\n### Installation command\n\n```\nnpm i labsmobile-sms\n```\n\n### Installation by modifying the composer.json file\n\n```\n\"dependencies\": {\n\t\"labsmobile-sms\": \"1.0.1\"\n}\n```\n\n## Examples of use cases\n\n**Send SMS**\n\nHere is an example of using the library to send a SMS:\n\n```javascript\nconst LabsMobileClient = require(\"labsmobile-sms/src/LabsMobileClient\");\nconst LabsMobileModelTextMessage = require(\"labsmobile-sms/src/LabsMobileModelTextMessage\");\nconst ParametersException = require(\"labsmobile-sms/src/Exception/ParametersException\");\nconst RestException = require(\"labsmobile-sms/src/Exception/RestException\");\n\nasync function sendSms() {\n  try {\n    const username = \"myusername\";\n    const token = \"mytoken\";\n    const message = \"Test SMS\";\n    const phone = [\"34XXXXXXXXX\"];\n    const clientLabsMobile = new LabsMobileClient(username, token);\n    const bodySms = new LabsMobileModelTextMessage(phone, message);\n    const response = await clientLabsMobile.sendSms(bodySms);\n    console.log(response);\n  } catch (error) {\n    if (error instanceof ParametersException) {\n      console.log(error.message);\n    } else if (error instanceof RestException) {\n      console.log(`Error: ${error.status} - ${error.message}`);\n    } else {\n      throw new Error(\"Error: \" + error);\n    }\n  }\n}\n```\n\n**Get account credits**\n\nHere is an example to learn credits for an existing account:\n\n```javascript\nconst LabsMobileClient = require(\"labsmobile-sms/src/LabsMobileClient\");\nconst ParametersException = require(\"labsmobile-sms/src/Exception/ParametersException\");\nconst RestException = require(\"labsmobile-sms/src/Exception/RestException\");\n\nasync function getCreditTest() {\n  try {\n    const username = \"myusername\";\n    const token = \"mytoken\";\n    const clientLabsMobile = new LabsMobileClient(username, token);\n    const response = await clientLabsMobile.getCredit();\n    console.log(response);\n  } catch (error) {\n    if (error instanceof ParametersException) {\n      console.log(error.message);\n    } else if (error instanceof RestException) {\n      console.log(`Error: ${error.status} - ${error.message}`);\n    } else {\n      throw new Error(\"Error: \" + error);\n    }\n  }\n}\n```\n\n**Manage scheduled sendings**\n\nHere is an example you can cancel or execute the scheduled sendings that are pending for execution:\n\n```javascript\nconst LabsMobileClient = require(\"labsmobile-sms/src/LabsMobileClient\");\nconst LabsMobileModelScheduledSendings = require(\"labsmobile-sms/src/LabsMobileModelScheduledSendings\");\nconst ParametersException = require(\"labsmobile-sms/src/Exception/ParametersException\");\nconst RestException = require(\"labsmobile-sms/src/Exception/RestException\");\n\nasync function scheduledSendingsTest() {\n  try {\n    const username = \"myusername\";\n    const token = \"mytoken\";\n    const subid = \"mysubid\";\n    const cmd = \"XXXXXX\"; // send or cancel\n    const clientLabsMobile = new LabsMobileClient(username, token);\n    const scheduledSendings = new LabsMobileModelScheduledSendings(subid, cmd);\n    const response = await clientLabsMobile.scheduledSendings(\n      scheduledSendings\n    );\n    console.log(response);\n  } catch (error) {\n    if (error instanceof ParametersException) {\n      console.log(error.message);\n    } else if (error instanceof RestException) {\n      console.log(`Error: ${error.status} - ${error.message}`);\n    } else {\n      throw new Error(\"Error: \" + error);\n    }\n  }\n}\n```\n\n**Get prices by country**\n\nHere is an example to know the credits that a single sending will take depending on the country of delivery:\n\n```javascript\nconst LabsMobileClient = require(\"labsmobile-sms/src/LabsMobileClient\");\nconst LabsMobileModelCountryPrice = require(\"labsmobile-sms/src/LabsMobileModelCountryPrice\");\nconst ParametersException = require(\"labsmobile-sms/src/Exception/ParametersException\");\nconst RestException = require(\"labsmobile-sms/src/Exception/RestException\");\n\nasync function getpricesCountryTest() {\n  try {\n    const username = \"myusername\";\n    const token = \"mytoken\";\n    const countries = [\"CO\", \"ES\"];\n    const clientLabsMobile = new LabsMobileClient(username, token);\n    const countriesPrice = new LabsMobileModelCountryPrice(countries);\n    const response = await clientLabsMobile.getpricesCountry(countriesPrice);\n    console.log(response);\n  } catch (error) {\n    if (error instanceof ParametersException) {\n      console.log(error.message);\n    } else if (error instanceof RestException) {\n      console.log(`Error: ${error.status} - ${error.message}`);\n    } else {\n      throw new Error(\"Error: \" + error);\n    }\n  }\n}\n```\n\n**HLR Request**\n\nHere is an example queries the mobile phone status with the related information like current operator, format, active, ported information, subscription country, etc:\n\n```javascript\nconst LabsMobileClient = require(\"labsmobile-sms/src/LabsMobileClient\");\nconst LabsMobileModelHlrRequest = require(\"labsmobile-sms/src/LabsMobileModelHlrRequest\");\nconst ParametersException = require(\"labsmobile-sms/src/Exception/ParametersException\");\nconst RestException = require(\"labsmobile-sms/src/Exception/RestException\");\n\nasync function hlrRequestTest() {\n  try {\n    const username = \"myusername\";\n    const token = \"mytoken\";\n    const numbers = [];\n    const clientLabsMobile = new LabsMobileClient(username, token);\n    const hlr = new LabsMobileModelHlrRequest(numbers);\n    const response = await clientLabsMobile.hlrRequest(hlr);\n    console.log(response);\n  } catch (error) {\n    if (error instanceof ParametersException) {\n      console.log(error.message);\n    } else if (error instanceof RestException) {\n      console.log(`Error: ${error.status} - ${error.message}`);\n    } else {\n      throw new Error(\"Error: \" + error);\n    }\n  }\n}\n```\n\n## Help\n\nIf you have questions, you can contact us through the support chat or through the support email support@labsmobile.com.\n\n[apidocs]: https://apidocs.labsmobile.com/\n[signUp]: https://www.labsmobile.com/en/signup\n[packages]: https://www.npmjs.com/package/labsmobile-sms\n[getnpm]: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabsmobile%2Fsms-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabsmobile%2Fsms-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabsmobile%2Fsms-node/lists"}