{"id":30420687,"url":"https://github.com/macabeus/react-gbajs","last_synced_at":"2025-08-22T08:19:53.152Z","repository":{"id":44829850,"uuid":"369032922","full_name":"macabeus/react-gbajs","owner":"macabeus","description":"🕹 GBA emulator on your React project - easy and powerful to use!","archived":false,"fork":false,"pushed_at":"2023-07-12T02:05:35.000Z","size":18859,"stargazers_count":77,"open_issues_count":3,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-05T10:57:53.631Z","etag":null,"topics":["emulator","gameboy-advance","gameboy-advance-emulator","romhacking"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-gbajs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/macabeus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-20T00:13:41.000Z","updated_at":"2025-05-20T11:51:49.000Z","dependencies_parsed_at":"2022-09-20T23:22:00.353Z","dependency_job_id":null,"html_url":"https://github.com/macabeus/react-gbajs","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/macabeus/react-gbajs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macabeus%2Freact-gbajs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macabeus%2Freact-gbajs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macabeus%2Freact-gbajs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macabeus%2Freact-gbajs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macabeus","download_url":"https://codeload.github.com/macabeus/react-gbajs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macabeus%2Freact-gbajs/sbom","scorecard":{"id":609131,"data":{"date":"2025-08-11","repo":{"name":"github.com/macabeus/react-gbajs","commit":"7efd0e03c1d36eb0f1bf50c53d97d2215f5d6236"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 2/19 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: COPYING:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: COPYING:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"66 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T02:14:14.698Z","repository_id":44829850,"created_at":"2025-08-21T02:14:14.698Z","updated_at":"2025-08-21T02:14:14.698Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271606604,"owners_count":24788981,"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-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["emulator","gameboy-advance","gameboy-advance-emulator","romhacking"],"created_at":"2025-08-22T08:19:53.087Z","updated_at":"2025-08-22T08:19:53.142Z","avatar_url":"https://github.com/macabeus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"/assets/logo.png\" height=\"75px\" /\u003e \n\n\u003e GBA emulator on your React project - easy and powerful to use!\n\nJust three steps to set it up ✨\n\n1 - Apply `GbaProvider`\n```jsx\nimport { GbaProvider } from 'react-gbajs'\n\nconst App = () =\u003e (\n  \u003cGbaProvider\u003e\n    ...\n  \u003c/GbaProvider\u003e\n)\n```\n\n2 - Get `play` function from `GbaContext` and call it with the game ROM\n```jsx\nimport { useContext } from 'react'\nimport { GbaContext } from 'react-gbajs'\n\nconst ButtonStartEmulator = () =\u003e {\n  const {\n    play,\n  } = useContext(GbaContext)\n\n  const startEmulator = () =\u003e {\n    const gameRom = getGameRom()\n    play({ newRomBuffer: gameRom })\n  }\n\n  return (\n    \u003cbutton onClick={() =\u003e startEmulator()}\u003e\n      Start Emulator\n    \u003c/button\u003e\n  )\n}\n```\n\n3 - And render the emulator using the default export\n\n```jsx\nimport ReactGbaJs from 'react-gbajs'\n\nconst Emulator = () =\u003e (\n  \u003cReactGbaJs /\u003e\n)\n```\n\nDone! 🎉 \u003cbr /\u003e\nCheck a full example in [`/sample`](sample).\n\n## How it works\n\nThis package is a React wrapper for [GBA.js](https://github.com/endrift/gbajs).\n\n`GBA.js` is vendored, with new features over the original version:\n- save and restore state\n- freeze address with a given value\n\n## Who is using\n\n\u003ctable align=\"center\"\u003e\n    \u003ctr\u003e\n        \u003ctd align=\"center\" width=\"50%\"\u003e\n          \u003cimg src=\"https://i.imgur.com/QxCoVPh.png\"\u003e\u003cbr /\u003e\n          \u003cstrong\u003e\u003ca href=\"https://github.com/macabeus/klo-gba.js\"\u003eklo-gba.js\u003c/a\u003e\u003c/strong\u003e, level editor for \u003cstrong\u003eKlonoa: Empire of Dreams\u003cstrong\u003e\n        \u003c/td\u003e\n        \u003ctd align=\"center\" width=\"50%\"\u003e\n          \u003ci\u003e\u003ca href=\"https://github.com/macabeus/react-gbajs/issues/new\"\u003eAdd your project here\u003c/a\u003e\u003c/i\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Features\n\n### `GbaContext`\n\n`GbaContext` exports the following properties:\n\n#### `play({ newRomBuffer, restoreState }): boolean`\n\nUse this function to start or restart the emulator.\n\nPass at `newRomBuffer` the game's ROM to load it:\n\n```js\nplay({ newRomBuffer: myGameRom })\n```\n\nYou can also fill the property `restoreState` to restore to a previous state saved using `saveState`. If both are present, the emulator will be reset loading the ROM, and then restored to the given state:\n\n```js\nplay({ newRomBuffer: myGameRom, restoreState: someState })\n```\n\nIf you pass only `restoreState`, the previous ROM will be re-loaded and will start on the given state. If there is no ROM previously loaded, it won't work.\n\n```js\nplay({ restoreState: someState })\n```\n\n#### `saveState()`\n\nReturn the serializable state of the emulator.\n\n#### `addFreezeAddress({ address: number, size: 8 | 16 | 32, value: number })`\n\nFreeze an address with the given value.\n\n#### `removeFreezeAddress(address: number)`\n\nRemove the freeze value on the given address.\n\n#### `frozenAddresses()`\n\nReturn the list of the addresses frozen in the following format:\n\n```ts\n{\n  [address in number]: { size: 8 | 16 | 32, value: number }\n}\n```\n\n### `\u003cReactGbaJs /\u003e`\n\n`\u003cReactGbaJs /\u003e` has the following props:\n\n#### `volume={number}` (optional)\n\nShould be a number between `0` (default, muted) or `1` (max volume).\n\n#### `onFpsReported={((fps: number) =\u003e void)}` (optional)\n\nCallback called every time that an FPS is reported.\n\n#### `scale={number}` (optional)\n\nSet the emulator scale. Default value is `1`, which has width 240px and height 160px.\n\n#### `onLogReceived={(level: 'error' | 'warn' | 'stub' | 'info', message: string) =\u003e void}` (optional)\n\nCallback called every time that a log is received within the levels set as `true` by the prop `watchLogLevels`.\n\n#### `watchLogLevels={{ error?: boolean, warn?: boolean, stub?: boolean, info?: boolean }}` (optional)\n\nSet when the callback `onLogReceived` should be called. By default the value is `{ error: true }`.\n\n# Contribution\n\n1 - Clone this repository\n\n```\n\u003e git clone git@github.com:macabeus/react-gbajs.git\n\u003e cd react-gbajs\n```\n\n2 - Install its dependencies\n  \n```\n\u003e npm i\n```\n\n3 - Build and watch the project\n\n```\n\u003e npm run start\n```\n\n4 - In another terminal window, go to the [`/sample`](sample) project, install its dependencies, and then build and watch it\n\n```\n\u003e cd sample\n\u003e npm i\n\u003e npm run start\n```\n\nFinished! Now you can develop the package and test it in real-time 🎉\n\n# Thanks\n\n[@endrift](https://twitter.com/endrift) for GBA.js.\u003cbr /\u003e\n[@felix.rodent](https://twitter.com/felixrodent) for the logo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacabeus%2Freact-gbajs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacabeus%2Freact-gbajs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacabeus%2Freact-gbajs/lists"}