{"id":23176105,"url":"https://github.com/nexmo-community/sms-google-translate-js","last_synced_at":"2025-07-23T01:31:49.457Z","repository":{"id":38798260,"uuid":"214187007","full_name":"nexmo-community/sms-google-translate-js","owner":"nexmo-community","description":"SMS Translation example using Google Cloud Translation API","archived":false,"fork":false,"pushed_at":"2025-05-28T07:42:33.000Z","size":34,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-28T08:37:15.035Z","etag":null,"topics":["extend","google-translate-api","sms"],"latest_commit_sha":null,"homepage":null,"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/nexmo-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2019-10-10T13:13:44.000Z","updated_at":"2023-07-02T21:28:43.000Z","dependencies_parsed_at":"2024-12-06T21:19:55.555Z","dependency_job_id":"bc563f35-3150-4a49-b86a-c1bfae3cb722","html_url":"https://github.com/nexmo-community/sms-google-translate-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nexmo-community/sms-google-translate-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fsms-google-translate-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fsms-google-translate-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fsms-google-translate-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fsms-google-translate-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nexmo-community","download_url":"https://codeload.github.com/nexmo-community/sms-google-translate-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nexmo-community%2Fsms-google-translate-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266602700,"owners_count":23954694,"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-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["extend","google-translate-api","sms"],"created_at":"2024-12-18T06:14:10.859Z","updated_at":"2025-07-23T01:31:49.429Z","avatar_url":"https://github.com/nexmo-community.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMS Translation with Google Cloud Translation API\n\n[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://nexmo.dev/google-nexmo-sms-translate-heroku)\n\nThis example uses Google Cloud Translation API to translate SMS messages to the language of your choice..\n\nSMS Messages sent through Nexmo will be sent to Google Cloud Translation API and the translation returned to the console.\n\n## Google Cloud Translation API\n\n+ Reference: [https://cloud.google.com/translate/docs/quickstarts](https://cloud.google.com/translate/docs/quickstarts)\n+ API Docs: [https://cloud.google.com/translate/docs/reference/rest/](https://cloud.google.com/translate/docs/reference/rest/)\n+ GitHub: [https://github.com/googleapis/nodejs-language](https://github.com/googleapis/nodejs-language)\n\nEnable the [Google Cloud Translation API](https://console.cloud.google.com/apis/library/translate.googleapis.com?q=translate\u0026id=c22f20ba-6a29-40ae-9084-8bc264a97fc2) and create a service user with the `Project \u003e Owner` role. Download the `google_creds.json` file for the service user. More information can be found here -\u003e [https://cloud.google.com/translate/docs/quickstart-client-libraries](https://cloud.google.com/translate/docs/quickstart-client-libraries)\n\n## Running the App\n\nThis sample app uses a `.env` file to provide the API key and URL.\n\nCopy the provided `.env.example` file to a new file called `.env`:\n\n```\ncp .env.example \u003e .env\n```\n\nThen update the values with the local file path of the `google_creds.json` file, and then save.\n\n```\nGOOGLE_APPLICATION_CREDENTIALS=\nTARGET_LANGUAGE='en'\n```\n\nAlso, expose the application to the internet using tools like [ngrok](https://ngrok.com/). To see how, [check out this guide](https://www.nexmo.com/blog/2017/07/04/local-development-nexmo-ngrok-tunnel-dr/).\n\n### Using Docker\n\nTo run the app using Docker, run the following command in a terminal:\n\n```\ndocker-compose up\n```\n\nThis will create a new image with all the dependencies and run it at http://localhost:3000.\n\n### Using Node\n\nTo run the app using node, run the following command in a terminal:\n\n```\nnpm install \u0026\u0026 node index.js\n```\n\nThis will install all the dependencies and run it at http://localhost:3000.\n\n## Linking the app to Nexmo\n\nFor this example app a Nexmo number and SMS webhook setup is needed.\n\nThis can be achieved with the Nexmo CLI. Install the CLI by following [these instructions](https://github.com/Nexmo/nexmo-cli#installation).\n\n### Rent a New Virtual Number\n\nRenting a number will need to be in place. This can also be achieved using the CLI by running this command:\n\n```\nnexmo number:buy --country_code US\n```\n\n### Adding the SMS Webhook\n\nUpdate the number created with the URL of the hosted or local server.\n\n```\nnexmo link:sms phone_number https://my-hostname/message\n```\n\n## Try it out\n\nWith the example Node application running in the terminal, send various SMS messages to the virtual number.  The terminal will output the response from Google Natural Language API.\n\n## Extend\nThis app prints out to the console. For integration with an application, extend the `translateText` function to suit your needs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo-community%2Fsms-google-translate-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexmo-community%2Fsms-google-translate-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo-community%2Fsms-google-translate-js/lists"}