{"id":18011261,"url":"https://github.com/cmdotcom/text-sdk-javascript","last_synced_at":"2025-10-04T22:55:13.089Z","repository":{"id":33152193,"uuid":"149456806","full_name":"cmdotcom/text-sdk-javascript","owner":"cmdotcom","description":"Javascript SDK to send messages with CM.com","archived":false,"fork":false,"pushed_at":"2024-06-13T12:59:43.000Z","size":703,"stargazers_count":7,"open_issues_count":10,"forks_count":11,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-10-04T01:48:24.118Z","etag":null,"topics":["business-messaging","chat","conversational","hacktoberfest","messaging","mms","push","rbm","rcs","sms","telegram","text","viber","wechat","whatsapp"],"latest_commit_sha":null,"homepage":"https://www.cm.com/communications-platform/","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/cmdotcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-09-19T13:41:19.000Z","updated_at":"2024-09-10T23:20:30.000Z","dependencies_parsed_at":"2023-01-14T23:38:55.267Z","dependency_job_id":"78b76d95-eed0-4172-87aa-6ca0cd100025","html_url":"https://github.com/cmdotcom/text-sdk-javascript","commit_stats":{"total_commits":47,"total_committers":12,"mean_commits":"3.9166666666666665","dds":"0.42553191489361697","last_synced_commit":"5be1c98482c981aad391a09b0287f40c4169602a"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/cmdotcom/text-sdk-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmdotcom","download_url":"https://codeload.github.com/cmdotcom/text-sdk-javascript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmdotcom%2Ftext-sdk-javascript/sbom","scorecard":{"id":294100,"data":{"date":"2025-08-11","repo":{"name":"github.com/cmdotcom/text-sdk-javascript","commit":"8233fff3baba3a2948c48c1edaa48db9ff8f87fa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":5,"reason":"Found 10/18 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/cmdotcom/text-sdk-javascript/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/cmdotcom/text-sdk-javascript/nodejs.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-8hc4-vh64-cxmj","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T19:02:17.800Z","repository_id":33152193,"created_at":"2025-08-17T19:02:17.800Z","updated_at":"2025-08-17T19:02:17.800Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278386109,"owners_count":25978113,"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-10-04T02:00:05.491Z","response_time":63,"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":["business-messaging","chat","conversational","hacktoberfest","messaging","mms","push","rbm","rcs","sms","telegram","text","viber","wechat","whatsapp"],"created_at":"2024-10-30T03:08:39.380Z","updated_at":"2025-10-04T22:55:13.056Z","avatar_url":"https://github.com/cmdotcom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @cmdotcom/text-sdk: A helper library to send text messages.\n\n[![Published on NPM](https://img.shields.io/npm/v/@cmdotcom/text-sdk.svg)](https://www.npmjs.com/package/@cmdotcom/text-sdk)\n![Node.js CI](https://github.com/cmdotcom/text-sdk-javascript/workflows/Node.js%20CI/badge.svg)\n[![Codecov](https://img.shields.io/codecov/c/github/cmdotcom/text-sdk-javascript.svg)](https://codecov.io/gh/cmdotcom/text-sdk-javascript)\n\n\nWant to send text-messages in your Node.js application? Then you are at the right place.\n\nThe package is currently limited in features compared to the CM gateway, but if you want to get all the functionalities, go to: [CM.com API Docs](https://developers.cm.com/messaging/docs)\n\n### Usage\n#### Node.JS\nFirst, run `npm install @cmdotcom/text-sdk`. Then, in your source file:\n```javascript\nconst messagingApi = require(\"@cmdotcom/text-sdk\");\n\n// Get your product token at CM.com.\nconst yourProductToken = \"\";\nconst myMessageApi = new messagingApi.MessageApiClient(yourProductToken);\n\nconst result = myMessageApi.sendTextMessage([\"00316012345678\"], \"TestSender\", \"Hello world?!\");\n\nresult.then((result) =\u003e {\n    console.log(result);\n}).catch((error) =\u003e {\n    console.log(error);\n});\n```\n\nor send multiple\n```javascript\nconst result = myMessageApi.sendTextMessage([\"00316012345678\",\"003160000000\"], \"TestSender\", \"Hello world?!\");\n```\n\nsend rich messages using the message builder\n```javascript\nconst richMessage = {\n    media: {\n        mediaName: \"cm.com\",\n        mediaUri: \"https://avatars3.githubusercontent.com/u/8234794?s=200\u0026v=4\"\n    },\n    text: \"Our logo!\"\n};\n\nconst suggestion = {\n    action: \"openUrl\",\n    label: \"Click me\",\n    url: \"https://www.cm.com\"\n};\n\nconst response = client.createMessage()\n    .setMessage([\"00316012345678\"], \"TestSender\", \"Hello world?!\")\n    .setAllowedChannels([\"Viber\"])\n    .setConversation([richMessage])\n    .setSuggestion([suggestion])\n    .send();\n\nresponse.then((result) =\u003e {\n    console.log(result);\n}).catch((error) =\u003e {\n    console.log(error);\n});\n```\n\nor send whatsapp template messages using the message builder\n```javascript\nconst template = {\n    whatsapp: {\n        elementName: 'template-name',\n        language: {\n            code: 'en',\n            policy: 'deterministic'\n        },\n        namespace: 'the-namespace-of-template',\n        components: [{\n            type: 'body',\n            parameters: [{\n                type: 'text',\n                text: 'firstname'\n            }]\n        }]\n    }\n};\n\nconst response = client.createMessage()\n    .setMessage([\"00316012345678\"], \"TestSender\", \"Hello world?!\")\n    .setAllowedChannels([\"WhatsApp\"])\n    .setTemplate(template)\n    .send();\n\nresponse.then((result) =\u003e {\n    console.log(result);\n}).catch((error) =\u003e {\n    console.log(error);\n});\n```\n\nor send whatsapp interactive messages using the message builder\n```javascript\nconst whatsAppInteractiveContent = {\n        type: 'list',\n        header: {\n            type: \"text\",\n            text: \"your-header-content\"\n        },\n        body: {\n            text: \"your-text-message-content\"\n        },\n        footer: {\n            text: \"your-footer-content\"\n        },\n        action: {\n            button: \"cta-button-content\",\n            sections: [{\n                title: \"your-section-title1\",\n                rows: [{\n                    id: \"unique-row-identifier1\",\n                    title: \"row-title-content\",\n                    description: \"row-description-content\"\n                }]\n            },\n            {\n                title: \"your-section-title2\",\n                rows: [{\n                    id: \"unique-row-identifier2\",\n                    title: \"row-title-content\",\n                    description: \"row-description-content\"\n                }]\n            }\n            ]\n        }\n};\n\nconst response = client.createMessage()\n    .setMessage([\"00316012345678\"], \"TestSender\", \"Hello world?!\")\n    .setAllowedChannels([\"WhatsApp\"])\n    .setInteractive(whatsAppInteractiveContent)\n    .send();\n\nresponse.then((result) =\u003e {\n    console.log(result);\n}).catch((error) =\u003e {\n    console.log(error);\n});\n```\n\n### License\n@cmdotcom/text-sdk is under the MIT license. See LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdotcom%2Ftext-sdk-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmdotcom%2Ftext-sdk-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmdotcom%2Ftext-sdk-javascript/lists"}