{"id":20262908,"url":"https://github.com/swapnilsoni1999/messages-web","last_synced_at":"2025-08-27T19:21:13.684Z","repository":{"id":41313000,"uuid":"342564242","full_name":"SwapnilSoni1999/messages-web","owner":"SwapnilSoni1999","description":":iphone: SMS gateway using your own phone!","archived":false,"fork":false,"pushed_at":"2024-01-04T19:08:33.000Z","size":120,"stargazers_count":104,"open_issues_count":15,"forks_count":29,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-07T18:09:16.124Z","etag":null,"topics":["google-messages","nodejs","puppeteer","sms-api","sms-gateway"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwapnilSoni1999.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-02-26T12:07:12.000Z","updated_at":"2025-05-02T17:34:24.000Z","dependencies_parsed_at":"2024-11-14T11:34:10.065Z","dependency_job_id":"0d01033b-7b08-4c16-8acd-09de64262f42","html_url":"https://github.com/SwapnilSoni1999/messages-web","commit_stats":{"total_commits":42,"total_committers":4,"mean_commits":10.5,"dds":0.09523809523809523,"last_synced_commit":"d6bed2f3b56de9cd7d8c8a37c1aa9aed73c2c963"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwapnilSoni1999%2Fmessages-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwapnilSoni1999%2Fmessages-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwapnilSoni1999%2Fmessages-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwapnilSoni1999%2Fmessages-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwapnilSoni1999","download_url":"https://codeload.github.com/SwapnilSoni1999/messages-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931555,"owners_count":21827112,"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":["google-messages","nodejs","puppeteer","sms-api","sms-gateway"],"created_at":"2024-11-14T11:32:29.530Z","updated_at":"2025-05-07T18:09:24.269Z","avatar_url":"https://github.com/SwapnilSoni1999.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Messages Cli Client\n\n### What is this?\n- this is a [Google Messages](https://messages.android.com) Client library to send message with a backend .eg. with express to send otp messages. This module uses your own number to work as a sms gateway api and you can send message to other person with your own number.\n\n### How to use\n\n1. install the package from [npm](https://npmjs.com/package/messages-web)\n\n```sh\nnpm install messages-web\n```\n\n2. Use it\n\n- Without credentials\n\n```js\nconst { default: MessagesClient } = require('messages-web')\nconst fs = require('fs')\n\nconst client = new MessagesClient()\n\nclient.on('qr-code', (base64Image) =\u003e {\n    // example code to save image\n    fs.writeFileSync('qr.jpg', base64Image.replace(/^data:image\\/png;base64,/, \"\"), { encoding: 'base64' })\n    // your code\n})\n\nclient.on('authenticated', async (service) =\u003e {\n    const inbox = service.getInbox()\n    const credentials = await client.getCredentials()\n    fs.writeFileSync('credentials.json', JSON.stringify(credentials, null, '\\t'))\n    await client.quit()\n})\n```\nThen you can use `credentials.json` file to login \n\n- With credentials\n\n```js\nconst { default: MessagesClient } = require('messages-web')\n\nconst credentials = MessagesClient.loadCredentialFile('credentials.json')\nconst client = new MessagesClient({ credentials })\n\nclient.on('authenticated', async (service) =\u003e {\n    const inbox = await service.getInbox()\n    console.log('Inbox', inbox)\n    await client.quit()\n})\n```\n\n3. send message\n\n```js\nconst { default: MessagesClient } = require('messages-web')\n\nconst credentials = MessagesClient.loadCredentialFile('credentials.json')\nconst client = new MessagesClient({ credentials })\n\nclient.on('authenticated', async (service) =\u003e {\n    console.log('Sending message...')\n    await service.sendMessage('+91987654321', 'Test message from SMS Client.') \n    console.log('Done!')\n    await client.quit()\n})\n```\n\n**Note**: `sendMessage` takes first arg as number with `countryCode + Number` second arg as TextMessage\n\n- Examples are given [here](https://github.com/SwapnilSoni1999/messages-web/tree/main/examples).\n\n### Todos\n- add pagination in getInbox\n- add sendMessage in Service\n- add public method in client to save credentials to a file\n- sendMessage: parse to var to check if country code is included or not\n- Rewrite docs with proper details\n- detect if phone is not connected\n- detect if web client is open in another browser or not\n\n# License \nISC - Swapnil Soni \u0026copy;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswapnilsoni1999%2Fmessages-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswapnilsoni1999%2Fmessages-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswapnilsoni1999%2Fmessages-web/lists"}