{"id":42363937,"url":"https://github.com/poki/phaser-plugin","last_synced_at":"2026-01-27T17:54:17.247Z","repository":{"id":40264078,"uuid":"398259373","full_name":"poki/phaser-plugin","owner":"poki","description":"Early experiments for a phaser plugin","archived":false,"fork":false,"pushed_at":"2024-11-19T15:57:08.000Z","size":3511,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-04T00:23:57.986Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poki.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}},"created_at":"2021-08-20T11:51:24.000Z","updated_at":"2025-12-13T13:06:55.000Z","dependencies_parsed_at":"2022-08-17T21:45:32.772Z","dependency_job_id":null,"html_url":"https://github.com/poki/phaser-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/poki/phaser-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poki%2Fphaser-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poki%2Fphaser-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poki%2Fphaser-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poki%2Fphaser-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poki","download_url":"https://codeload.github.com/poki/phaser-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poki%2Fphaser-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28817619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"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":[],"created_at":"2026-01-27T17:54:14.985Z","updated_at":"2026-01-27T17:54:17.239Z","avatar_url":"https://github.com/poki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poki Phaser 3 Plugin\nA Phaser 3 plugin to easially integrate the Poki SDK\n\n- - -\n\nHi! 👋 This is the official Poki Phaser Plugin for \n[Phaser 3](https://phaser.io/phaser3). This plugin will automate most of \nimplementing the [Poki SDK](https://sdk.poki.com/) when making a game with \nPhaser.\n\n### Features\n\n- Inject \u0026 load the Poki SDK for you (asynchronously)\n- Trigger _loadingStart/loadingFinished_ event when loading\n- _gameplayStart/gameplayStop_ events fire automatically when your game scene \n  starts and stops\n  - _commercialBreak_ is requested before _gameplayStart_ is fired\n- Disable input and audio during video ads\n- Give you easy/global access to the SDK using `scene.plugins.get('poki')` \n  so you can:\n    - request a _rewardedBreak_\n    - or manually make gameplayStart/gameplayStop\n\n## How to use/install\n\nThis is a quick step by step tutorial on how to use our plugin. You can also \nalways check the example in the [/example](example/) directory.\n\n### Add the dependency\n\nFirst, you have to make sure to add the `@poki/phaser-3` plugin as a dependency \nto your project:\n```bash\n$ npm install @poki/phaser-3\n# or\n$ yarn add @poki/phaser-3\n```\n\n### Install plugin to Phaser's configuration\n\nStep two is to add the plugin to the plugins section of your Phaser \nconfiguration, for example:\n```javascript\nimport { PokiPlugin } from '@poki/phaser-3'\n// ...\nconst config = {\n  // ...\n  plugins: {\n    global: [\n      {\n        plugin: PokiPlugin,\n        key: 'poki',\n        start: true, // must be true, in order to load\n        data: {\n          // This must be the key/name of your loading scene\n          loadingSceneKey: 'LoadingScene',\n\n          // This must be the key/name of your game (gameplay) scene\n          gameplaySceneKey: 'PlayScene',\n\n          // This will always request a commercialBreak when gameplay starts,\n          // set to false to disable this behaviour (recommended to have true,\n          // see Poki SDK docs for more details).\n          autoCommercialBreak: true\n        }\n      }\n    ]\n  }\n}\n// ...\nvar game = new Phaser.Game(config)\n```\n(more info on Phaser's configuration \n[here](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/game/))\n\n\n### Usage\n\n#### Loading \u0026 Gameplay Events\n\nThe Poki Phaser plugin will automatically call `PokiSDK.gameLoadingStart()` and\n`PokiSDK.gameLoadingStop();` if the _loadingSceneKey_ is configured. The same is\ntrue for the set _gameplaySceneKey_.\n\nIf your game doesn't use multiple scenes for gameplay you can manually call\nthe events like so:\n\n```javascript\nconst poki = scene.plugins.get('poki') // get the plugin from the Phaser PluginManager\npoki.gameplayStart()\n// ... start gameplay ...\nscene.on('player_died', () =\u003e {\n  poki.gameplayStop()\n})\n```\n\n#### On Initialized\n\nTo run code only when the PokiSDK is initialized you can use the following \ninterface:\n\n```javascript\nconst poki = scene.plugins.get('poki') // get the plugin from the Phaser PluginManager\npoki.runWhenInitialized((poki) =\u003e {\n  // This is called after the PokiSDK is fully initialized, or immediately if\n  // the PokiSDK has already been initialized.\n})\n```\n\n\n## Example\n\nThis repository contains an example on how to use the Poki Phaser 3 plugin in \nthe [/example](example/) directory. The main configuration/setup is done in the\n[example/game.js](example/game.js) file.\n\nThe example game consist of a Loading-, Menu-, and Playscene to show the way the\nplugin works with the Poki 'gameplayStart' event etc.\n\nCheckout the MenuScene for an extensive example of using this library where we \nwait for the Poki SDK to be completely initialized, check if an adblock is \ndetected and allows players to watch a rewarded adbreak. You can find this \n[code here](example/scenes/menu.js#L27).\n\nTo run the example use the following command:\n```bash\n$ yarn watch\nServer running at http://localhost:1234\n```\nAnd point your browser to http://localhost:1234\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoki%2Fphaser-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoki%2Fphaser-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoki%2Fphaser-plugin/lists"}