{"id":27500901,"url":"https://github.com/junwen-k/onewaysms-sdk-deno","last_synced_at":"2026-05-04T07:35:59.560Z","repository":{"id":144283164,"uuid":"267660229","full_name":"junwen-k/onewaysms-sdk-deno","owner":"junwen-k","description":"A non-official OneWaySMS SDK written for Deno runtime. Based on the latest v1.3 OneWaySMS API documentation.","archived":false,"fork":false,"pushed_at":"2020-06-02T18:02:15.000Z","size":51,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-27T11:33:54.236Z","etag":null,"topics":["deno","onewaysms"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/junwen-k.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"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,"zenodo":null}},"created_at":"2020-05-28T18:01:40.000Z","updated_at":"2023-09-21T09:05:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"e71a0cba-de55-4edf-a2b8-ff9b216e4b01","html_url":"https://github.com/junwen-k/onewaysms-sdk-deno","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/junwen-k/onewaysms-sdk-deno","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junwen-k%2Fonewaysms-sdk-deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junwen-k%2Fonewaysms-sdk-deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junwen-k%2Fonewaysms-sdk-deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junwen-k%2Fonewaysms-sdk-deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junwen-k","download_url":"https://codeload.github.com/junwen-k/onewaysms-sdk-deno/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junwen-k%2Fonewaysms-sdk-deno/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32599311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"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":["deno","onewaysms"],"created_at":"2025-04-17T12:55:50.101Z","updated_at":"2026-05-04T07:35:59.522Z","avatar_url":"https://github.com/junwen-k.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneWaySMS SDK for Deno\n\nA non-official OneWaySMS SDK written for Deno runtime. Based on the latest [v1.3](http://smsd2.onewaysms.sg/api.pdf) OneWaySMS API documentation.\n\n[![license](https://img.shields.io/github/license/junwen-k/onewaysms-sdk-deno)](https://raw.githubusercontent.com/junwen-k/onewaysms-sdk-deno/master/LICENSE.txt)\n\n## Installing\n\nImport the SDK by using a URL.\n\n```ts\nimport {\n  OneWay,\n  OneWayError,\n  OneWayErrorType,\n} from \"https://deno.land/x/gh:junwen-k:onewaysms-sdk-deno/mod.ts\";\n```\n\nInclude the version tag in the URL to install a specific version of the SDK.\n\n```ts\nimport {\n  OneWay,\n  OneWayError,\n  OneWayErrorType,\n} from \"https://deno.land/x/gh:junwen-k:onewaysms-sdk-deno@v0.1.0/mod.ts\";\n```\n\n## Usage and Getting Started\n\n### Initializing a new client\n\nInitialize a new client with the exported `OneWay` class. For instance:\n\n```ts\nconst svc = new OneWay({\n  baseURL: \"API_BASE_URL\",\n  apiUsername: \"API_USERNAME\",\n  apiPassword: \"API_PASSWORD\",\n  senderID: \"SENDER_ID\",\n});\n```\n\n### Use case examples\n\n1. **Send SMS** - Send SMS by calling OneWaySMS API gateway, returning mobile terminating ID(s) if request is successful.\n\n   ```ts\n   try {\n     const data = await svc.sendSMS({\n       message: \"Hello, 世界\",\n       mobileNo: [\"60123456789\", \"60129876543\"],\n     });\n     // mtIDs - Mobile terminating IDs\n     console.log(data.mtIDs);\n   } catch (err) {\n     if (err instanceof OneWayError) {\n       switch (err.code) {\n         case OneWayErrorType.RequestFailure:\n         // Handle RequestFailure\n         case OneWayErrorType.InvalidCredentials:\n         // Handle InvalidCredentials\n         case OneWayErrorType.InvalidSenderID:\n         // Handle InvalidSenderID\n         case OneWayErrorType.InvalidMobileNo:\n         // Handle InvalidMobileNo\n         case OneWayErrorType.InvalidLanguageType:\n         // Handle InvalidLanguageType\n         case OneWayErrorType.InvalidMessageCharacters:\n         // Handle InvalidMessageCharacters\n         case OneWayErrorType.InsufficientCreditBalance:\n         // Handle InsufficientCreditBalance\n         case OneWayErrorType.UnknownError:\n         // Handle UnknownError\n         default:\n       }\n     } else {\n       // Handle Generic Error\n     }\n   }\n   ```\n\n1. **Check MT Transaction Status** - Check mobile terminating transaction status based on mobile terminating ID provided. Mobile terminating ID can be obtained by calling send SMS API.\n\n   ```ts\n   try {\n     const data = await svc.checkTransactionStatus({ mtID: 145712470 });\n     switch (data.status) {\n       case MTTransactionStatus.Success:\n       // Handle success status\n       case MTTransactionStatus.TelcoDelivered:\n       // Handle telco delivered status\n       default:\n     }\n   } catch (err) {\n     if (err instanceof OneWayError) {\n       switch (err.code) {\n         case OneWayErrorType.MTInvalidNotFound:\n         // Handle MTInvalidNotFound\n         case OneWayErrorType.MessageDeliveryFailure:\n         // Handle MessageDeliveryFailure\n         case OneWayErrorType.UnknownError:\n         // Handle UnknownError\n         default:\n       }\n     } else {\n       // Handle Generic Error\n     }\n   }\n   ```\n\n1. **Check Credit Balance**. Check remaining credit balance for the account in the client's config.\n\n   ```ts\n   try {\n     const data = await svc.checkCreditBalance();\n     // creditBalance - Remaining credit balance for this account\n     console.log(data.creditBalance);\n   } catch (err) {\n     if (err instanceof OneWayError) {\n       switch (err.code) {\n         case OneWayErrorType.InvalidCredentials:\n         // Handle InvalidCredentials\n         case OneWayErrorType.UnknownError:\n         // Handle UnknownError\n         default:\n       }\n     } else {\n       // Handle Generic Error\n     }\n   }\n   ```\n\n## License\n\nThis SDK is distributed under the MIT License, see LICENSE.txt for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunwen-k%2Fonewaysms-sdk-deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunwen-k%2Fonewaysms-sdk-deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunwen-k%2Fonewaysms-sdk-deno/lists"}