{"id":21743933,"url":"https://github.com/telefonica/latch-sdk-ruby","last_synced_at":"2025-06-18T21:44:10.983Z","repository":{"id":12430715,"uuid":"15086733","full_name":"Telefonica/latch-sdk-ruby","owner":"Telefonica","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-12T18:03:39.000Z","size":1739,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-20T04:38:47.223Z","etag":null,"topics":["dir-cto","org-cdo","public","srv-latch","srv-livingapps"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Telefonica.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-12-10T19:15:03.000Z","updated_at":"2024-03-21T12:40:55.000Z","dependencies_parsed_at":"2025-04-13T05:06:42.492Z","dependency_job_id":"d133bddd-6a65-4ec3-8705-9e6e50a4ee56","html_url":"https://github.com/Telefonica/latch-sdk-ruby","commit_stats":{"total_commits":21,"total_committers":7,"mean_commits":3.0,"dds":"0.47619047619047616","last_synced_commit":"cc310300ab72522727294f46b3283aabe635099a"},"previous_names":["elevenpaths/latch-sdk-ruby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Telefonica/latch-sdk-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Telefonica","download_url":"https://codeload.github.com/Telefonica/latch-sdk-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flatch-sdk-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260640055,"owners_count":23040463,"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":["dir-cto","org-cdo","public","srv-latch","srv-livingapps"],"created_at":"2024-11-26T07:09:27.213Z","updated_at":"2025-06-18T21:44:05.971Z","avatar_url":"https://github.com/Telefonica.png","language":"Ruby","readme":"### LATCH RUBY SDK ###\n\n\n#### PREREQUISITES ####\n\n* Ruby 1.9.3 or above.\n\n* Read API documentation (https://latch.telefonica.com/www/developers/doc_api).\n\n* To get the \"Application ID\" and \"Secret\", (fundamental values for integrating Latch in any application), it’s necessary to register a developer account in Latch's website: https://latch.telefonica.com. On the upper right side, click on \"Developer area\".\n\n\n#### USING THE SDK IN RUBY ####\n\n* Require \"Latch\". Keep in mind where the SDK is placed inside your folder structure.\n```\n\trequire_relative '/latch/Latch'\n```\n\n* Create a Latch object with the \"Application ID\" and \"Secret\" previously obtained.\n```\n\tapi = Latch.new(appid, app_secret)\n```\n\n* Call to Latch Server. Pairing will return an account id that you should store for future api calls\n```\n     pairResponse = api.pair(PAIRING_CODE_HERE)\n     statusResponse = api.status(ACCOUNT_ID_HERE)\n     unpairResponse = api.unpair(ACCOUNT_ID_HERE)\n```\n\n* After every API call, get Latch response data and errors and handle them.\n```\n\tresponseData = response.data\n\tresponseError = response.error\n  ```\n  \n  \n## USING RUBY SDK FOR WEB3 SERVICES ##\n\nFor using the Ruby SDK within an Web3 service, you must complain with the following:\n\n* It is necessary to have a developer subscription that allows you to create web3 apps. \n* You need metamask extension for Google Chrome [Download metamask](https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn)\n* You need a wallet to operate on Polygon. You can easily create one through Metamask.\n\n\n### Creation of a WEB3 Latch app ###\n\nOnce you have your developer Latch account created, you must logging in the website.\n\n[Steps to add  new web3 app in latch-website](doc/Latch_WEB3_Apps.pdf)\n\nWe add a new method to pair the web3 applications, now we have two new parameters.\nThe two additional parameters are:\n- WEB3WALLET: The Ethereum-based address wallet for the user that wants to pair the service.\n- WEB3SIGNATURE: A proof-of-ownership signature of a constant, in order to verify that the user owns the private key of the wallet. You can use https://etherscan.io/verifiedSignatures# to sign the following message:\n  - MESSAGE TO SIGN : \"Latch-Web3\"\n\n* Call to Latch Server for pairing as usual, but with the newly methods:\n\n```\n    api = latch.Latch(APP_ID, SECRET_KEY)\n    # PAIR\n    response = api.pair(pairing_code, WEB3WALLET, WEB3SIGNATURE)\n```\n\n\nYou have an example of use in the file [example for web3 app](example/example.rb)\n  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelefonica%2Flatch-sdk-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelefonica%2Flatch-sdk-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelefonica%2Flatch-sdk-ruby/lists"}