{"id":20294173,"url":"https://github.com/grab/superapp-sdk","last_synced_at":"2025-04-11T11:42:32.043Z","repository":{"id":34865724,"uuid":"184696514","full_name":"grab/superapp-sdk","owner":"grab","description":"SDK for Grab SuperApp WebView.","archived":false,"fork":false,"pushed_at":"2023-06-12T05:37:15.000Z","size":104,"stargazers_count":16,"open_issues_count":6,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T08:02:58.042Z","etag":null,"topics":[],"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/grab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-05-03T04:03:42.000Z","updated_at":"2024-02-22T23:00:45.000Z","dependencies_parsed_at":"2024-06-19T19:02:56.143Z","dependency_job_id":null,"html_url":"https://github.com/grab/superapp-sdk","commit_stats":{"total_commits":35,"total_committers":4,"mean_commits":8.75,"dds":"0.34285714285714286","last_synced_commit":"ae4ba9d4f21e48798b799d6cc0320535eb028811"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fsuperapp-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fsuperapp-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fsuperapp-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fsuperapp-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grab","download_url":"https://codeload.github.com/grab/superapp-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248385759,"owners_count":21094938,"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":[],"created_at":"2024-11-14T15:28:07.892Z","updated_at":"2025-04-11T11:42:32.026Z","avatar_url":"https://github.com/grab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript to Native bridge communication\n\n## Overview\n\nCommunication between web-app and native Grab app happens via web bridge. Each request and\nresponse object must have a structure defined in this document.\n\n## Currently available modules\n\n- [Location Module](https://github.com/grab/superapp-sdk/blob/master/docs/LocationModule.md).\n- [Media Module](https://github.com/grab/superapp-sdk/blob/master/docs/MediaModule.md).\n- [Scope Module](https://github.com/grab/superapp-sdk/blob/master/docs/ScopeModule.md).\n- [Locale Module](https://github.com/grab/superapp-sdk/blob/master/docs/LocaleModule.md).\n- [Storage Module](https://github.com/grab/superapp-sdk/blob/master/docs/StorageModule.md)\n- [Platform Module](https://github.com/grab/superapp-sdk/blob/master/docs/PlatformModule.md)\n\nOne point to note is that partner engineers need to call `ScopeModule.reloadScopes` after redirection to partner website to load permissions from `GrabID`:\n\n```javascript\nconst scopeModule = new ScopeModule();\nawait scopeModule.reloadScopes();\n```\n\nAfterwards, calls to module methods will reflect actual permissions.\n\n## Request\n\nEach request to native API should be done through JavaScript bridge provided by Grab. Please refer to specific Module API documentation for more details\n\n## Response\n\nEach resonse from the native bridge follows the same structure described bellow.\n\n| Key         | Type                     | Description                                                                        |\n| ----------- | ------------------------ | ---------------------------------------------------------------------------------- |\n| status_code | Integer                  | Response status code (see list of codes below)                                     |\n| result      | Object or primitive type | Result object according to method specification (required for **200** status code) |\n| error       | String                   | Error message (required for **non-200** status codes)                              |\n\n### Response status codes\n\n| Code | Type              | Description                                                                     |\n| ---- | ----------------- | ------------------------------------------------------------------------------- |\n| 200  | OK                | Request successful, **result** value contains response data                     |\n| 204  | No Content        | Request successful, **result** value doesn't contain data                       |\n| 400  | Bad Request       | The request is malformed (e.g. missing **parameters**, missing **method** name) |\n| 403  | Forbidden         | The client doesn't have permission to access this method                        |\n| 424  | Failed Dependency | Underlying request returned an error                                            |\n| 500  | Internal Error    | Unexpected internal error (e.g. failed to serialize response object)            |\n\n### Success response example\n\n```json\n{\n  \"status_code\": 200,\n  \"result\": {\n    \"latitude\": 1.234523,\n    \"longitude\": 1.4356345\n  }\n}\n```\n\n### Failure response example\n\n```json\n{\n  \"status_code\": 403,\n  \"error\": \"Client doesn't have access to method \\\"getLocation\\\" in module \\\"LocationModule\\\"\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrab%2Fsuperapp-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrab%2Fsuperapp-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrab%2Fsuperapp-sdk/lists"}