{"id":25025440,"url":"https://github.com/mattijsf/react-native-tango-webview","last_synced_at":"2026-05-19T07:34:59.641Z","repository":{"id":196020079,"uuid":"645338838","full_name":"mattijsf/react-native-tango-webview","owner":"mattijsf","description":"React Native library that enables easy communication between a WebView and React Native components using tango-rpc","archived":false,"fork":false,"pushed_at":"2023-05-30T12:52:13.000Z","size":1116,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T09:50:15.153Z","etag":null,"topics":["react-native","rpc","tango-rpc","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-tango-webview","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/mattijsf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-05-25T12:38:57.000Z","updated_at":"2025-06-21T01:19:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"d23d6259-3dec-44f6-8c67-eba1f2cf351d","html_url":"https://github.com/mattijsf/react-native-tango-webview","commit_stats":null,"previous_names":["mattijsf/react-native-tango-webview"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/mattijsf/react-native-tango-webview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattijsf%2Freact-native-tango-webview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattijsf%2Freact-native-tango-webview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattijsf%2Freact-native-tango-webview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattijsf%2Freact-native-tango-webview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattijsf","download_url":"https://codeload.github.com/mattijsf/react-native-tango-webview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattijsf%2Freact-native-tango-webview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33206320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:16:55.748Z","status":"ssl_error","status_checked_at":"2026-05-19T07:16:54.366Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["react-native","rpc","tango-rpc","typescript"],"created_at":"2025-02-05T16:39:47.087Z","updated_at":"2026-05-19T07:34:59.601Z","avatar_url":"https://github.com/mattijsf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-tango-webview\n\nReact Native library that enables easy communication between a WebView and React Native components using the [tango-rpc](https://github.com/mattijsf/tango-rpc) library. It simplifies the integration of WebView into React Native applications and facilitates data exchange and method invocation between the two environments using a typescript interface.\n\n## Installation\n\n```sh\nnpm install react-native-tango-webview\n```\nor\n```sh\nyarn add react-native-tango-webview\n```\n\n## Usage\n\n```tsx\n// ...\nimport TangoWebview, { TANGO_RPC_WEBVIEW_SCRIPT } from \"react-native-tango-webview\"\n\ntype ClientAPI = {\n  sayHi(message: string): Promise\u003cboolean\u003e\n  sayHiThroughCallback(cb: (message: string) =\u003e void): Promise\u003cvoid\u003e\n}\n\nconst HTML = `\n\u003chtml\u003e\n  \u003cbody style=\"background-color:lightgrey;\"\u003e\n    \u003cscript\u003e\n      ${TANGO_RPC_WEBVIEW_SCRIPT} \u003c!-- OR: \u003cscript src=\"https://unpkg.com/react-native-tango-webview/dist/umd/tango-rpc.mjs\"\u003e\u003c/script\u003e --\u003e\n\n      const myApi = {\n        sayHi(message) {\n          alert(message)\n          return true\n        },\n        sayHiThroughCallback(cb) {\n          cb(\"Hi from web\")\n        }\n      };\n\n      const server = new TangoRPC.Server(createWebViewChannel(), myApi)\n      server.onConnect(() =\u003e console.log(\"Server Connected\"))\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e`\n\nexport default function App(): JSX.Element {\n  const [clientApi, setClientApi] = useState\u003cClientAPI\u003e()\n\n  const showMessage = useCallback(async () =\u003e {\n    if (!clientApi) return\n    const result = await clientApi.sayHi(\"Hello World!\")\n    console.log(result) // true\n  }, [clientApi])\n\n  const doCallback = useCallback(async () =\u003e {\n    if (!clientApi) return\n    await clientApi.sayHiThroughCallback(message =\u003e console.log(\"Callback:\" + message))\n  }, [clientApi])\n\n  return (\n    \u003c\u003e\n      \u003cTangoWebview style={{ flex: 1 }} onConnect={setClientApi} source={{ html: HTML }} /\u003e\n      \u003cButton disabled={!clientApi} onPress={showMessage} title=\"sayHi\" /\u003e\n      \u003cButton disabled={!clientApi} onPress={doCallback} title=\"doCallback\" /\u003e\n    \u003c/\u003e\n  )\n}\n\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattijsf%2Freact-native-tango-webview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattijsf%2Freact-native-tango-webview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattijsf%2Freact-native-tango-webview/lists"}